썸네일: oneook

4주차 서브젝트

1. 상속

#[상속](<https://soooh.notion.site/f17c9819ad39474a813eb56df37e80f3>) #하위클래스의생성순서 #상위클래스생성자호출 #[super](<https://soooh.notion.site/super-super-e5486fb465e144f38cc3ce6b00b4b080>) #[protected](<https://soooh.notion.site/f17c9819ad39474a813eb56df37e80f3>)

2. 오버라이딩

#[overriding](<https://soooh.notion.site/37fb12fd7a9e4d9e991084eba631e466>) #업캐스팅(upcasting) #[묵시적형변환](<https://soooh.notion.site/37fb12fd7a9e4d9e991084eba631e466>) #상속에서의상위클래스와하위클래스의메모리상태 #가상메서드 #[다형성](<https://soooh.notion.site/polymorphism-b3b6d2277bec4d3c9b90416641c31745>)(polymorphism)

3. 다운캐스팅

#다운캐스팅 #instanceof #명시적형변환

Q. 상속을 언제 사용할 것인가?

Q. 상속이 코드의 재사용을 위한 일반적인 방법이 아니라고 하면 코드를 재사용하기 위한 방법은 무엇이 있을까?

Q. IS-A 와 HAS-A 관계

Q. 하위 클래스가 상위 클래스 형으로 묵시적 형변환이 되는 이유를 메모리로 설명하세요

상속

오버라이딩

다운캐스팅