java
// 创建Spring上下文(容器)
ClassPathXmlApplicationContext context =
new ClassPathXmlApplicationContext("ApplicationContext.xml");
// 从容器中获取bean,假设我们有一个名为 'helloWorld' 的bean
test helloWorld = context.getBean("helloWorld", test.class);
// 使用bean
helloWorld.sayHello();
// 关闭上下文
context.close();







重点
