springIOC (4)

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(); } }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zywsff.html