TestObject代码示例:
public class TestIocDI { public static void main(String[] args) { //获取spring对象 ApplicationContext ac = new ClassPathXmlApplicationContext("applicationcontext.xml"); Student stu = (Student) ac.getBean("stu"); System.out.println(stu); stu.testStu(); } }springIOC (4)
内容版权声明:除非注明,否则皆为本站原创文章。