@PostConstruct (1) 썸네일형 리스트형 new -> autowrite 생성자 이해하기 JAVA 의 고전적인 객체 주입 사용법 ✔ TestController public class TestController { private TestService service; public TestController( ) { this.service = new TestService(); } } ✔ TestService public class TestService { public TestService( ) { System.out.print("TestService 생성 완료") } } 위에 TestController 의 생성자에서 하는일처럼 기초적인 자바에서는 new 를 이용해서 객체를 주입해. 즉, TestController 에서 TestService 에 접근하기 위해서 new 를 사용해서 TestServic.. 이전 1 다음