»ó¼Ó (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