TIL
TIL_024
Mon Groy
2024. 5. 23. 21:06
https://mongroy.tistory.com/66
다형성(Polymorphism)
Parent parent1 = new Parent();가능Child child1 = new Child();가능Parent parent2 = new Child();가능Child child2 = new Parent(); 불가능parent1 = (Parent) child2;업캐스팅child1 = (Child) parent2;다운캐스팅 (조심해야 함)Parent instanceo
mongroy.tistory.com
https://mongroy.tistory.com/67
Bean의 생명주기와 그것을 알게 되었을 때의 이점
Step 1. 사용되기 위한 준비단계 스프링 컨테이너 생성 → 객체(빈) 생성 → 의존관계 주입(예외: 생성자)→ 스프링이 초기화 콜백(알림) → 빈 초기화(필요값이 다 들어 있는 상태로 일을
mongroy.tistory.com
https://mongroy.tistory.com/65
생성자
메서드와 비슷한 기능을 가지고 있는데굳이 생성자를 사용하는 이유 메서드를 사용하는 경우Class MemberManagement 에public Manage(int id, int roomnumber) {} 가 있다면다른 클래스에서 사용할 때MemberManagemen
mongroy.tistory.com