상속 (Inheritance)
상속 (Inheritance)
- 개념
- A object type (class) can be specialized into lower-level object types.
- A graphic figure can be a line, a polygon, or a circle.
- A student can be a undergraduate or a graduate student.
- Inheritance is a technique allowing new classes to be defined on top of existing classes, rather than rewriting the classes from the scratch.
- Classes are created by first inheriting all the attributes and methods defined by some less specifics class (superclass) and
- then adding increasingly specialized attributes and methods.
- Inheritance eliminates the redundancy of storing the same datum or procedure more often than necessary.
- 용어
- 수퍼 클래스 (Superclass)
- 서브 클래서 (Subclass)
- 클래스 상속 구조 (Class Inheritance Hierarchy)
Notes:
- Terms
- Superclass: Base Class, Parent Class
- Subclass: Drived Class, Child Class