You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
person1 is Person // true
person1 is Student // false
person1 is Undergraduate // false
student1 is Person // true
student1 is Student // true
student1 is Undergraduate // false
undergraduate1 is Person // true
undergraduate1 is Student // true
undergraduate1 is Undergraduate // true
이해가 감?
상속의 구조를 이해하고 살펴보면 쉬움
위의 그림을 보면 Undergraduate() 는 Student, Person의 더 큰 범위임
ㅇㅋ 여기까지임
The text was updated successfully, but these errors were encountered:
타입캐스팅
is연산자
as연산자
를 알아보겠음클래스 부분에서 두 키워드를 사용함
왜냐면 클래스는
상속
이 가능하기 때문임클래스의 상속에 관해 간단한 예시를 살펴보겠음
여기서
상속
은 저장 프로퍼티를 추가하는 관점에서 보겠음이런 식으로 인스턴스를 생성하고 프로퍼티에 접근이 가능해짐
is 연산자
is 연산자
는 타입에 대한 검사를 수행하는 연산자임True 아니면 False 밖에 나오지 않을 거임
위에서 만든 인스턴스에 빗대어 예시를 살펴보겠음
이해가 감?
상속의 구조를 이해하고 살펴보면 쉬움
위의 그림을 보면 Undergraduate() 는 Student, Person의 더 큰 범위임
ㅇㅋ 여기까지임
The text was updated successfully, but these errors were encountered: