Skip to content · ⁨본문 바로가기⁩
English

Inheritance: building on a class

  • Inheritance lets one class reuse another class's fields and methods.
  • The class you build on is the superclass (parent); the new class is the subclass (child).
  • A subclass is-a kind of its superclass: a Dog is an Animal.

한국어

상속: 클래스 확장하기

  • 상속은 한 클래스가 다른 클래스의 필드와 메소드를 재사용할 수 있게 합니다.
  • 확장하는 기존 클래스는 superclass(부모)이며, 새로운 클래스는 subclass(자손)입니다.
  • 서브클래스는 슈퍼클래스의 일종입니다: Dog is an Animal입니다.

Animal 슈퍼클래스; Dog와 Cat은 각각 이를 확장하며 speak()를 오버라이드함

Handout · ⁨교재 자료⁩

Log in or create account · ⁨로그인 또는 계정 만들기⁩

IGCSE, A-Level & AP