인프런 커뮤니티 질문&답변
답변 1
0
안녕하세요.ohjinseok님, 공식 서포터즈 OMG입니다.
AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext(TestBean.class, ClientBean.class, PrototypeBean.class);
TestBean tes = ac.getBean(TestBean.class);
tes.addCount(); // 호출1
System.out.println(tes.getCount());
TestBean testBean = new TestBean();
tes.addCount();// 호출2
System.out.println(testBean.getCount());
생각 하신 시나리오에서
tes.addCount();를 두번 호출 하는게 맞나요?
감사합니다.





