publicclassClient{publicstaticvoidmain(String[] args)throwsInterruptedException{for(int i =0; i <5; i++){IAccountService accountService =(IAccountService)BeanFactory.getBean("accountService");
accountService.saveAccount();}}}
publicclassAccountServiceImplimplementsIAccountService{privateIAccountDao accountDao =(IAccountDao)BeanFactory.getBean("accountDao");publicvoidsaveAccount(){int i =1;//建议按注释写法来//accountDao = (IAccountDao) BeanFactory.getBean("accountDao");
accountDao.saveAcoount();System.out.println(i);
i++;}}
public class Client { public static void main(String[] args) throws InterruptedException { for (int i = 0; i < 5; i++) { IAccountService accountService = (IAccountService)BeanFactory.getBean("accountService"); accoun