public class Ioc { public static void main(String[] args) { ClassPathXmlApplicationContext applicationContext=new ClassPathXmlApplicationContext("src/bean.xml"); IocDaoService ids=(IocDaoService)applicationContext.getBean("iocService"); ids.sayhello(); } }
九.显示结果:
到这里Ioc的模拟就结束了.