📄 helloclient.java
字号:
package com.djr.client;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import com.djr.hello.HelloService;
public class HelloClient {
public static void main(String[] args) {
// 通过配置文件创建控制反转的容器
ApplicationContext ac = new FileSystemXmlApplicationContext(
"src/applicationContext.xml");
// 通过容器获得服务接口的实现
HelloService helloService = (HelloService)ac.getBean("helloService");
// 调用服务接口的方法
helloService.sayHello();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -