Content deleted Content added
m Establishing abbreviation. |
→Inheritance: better links, rewrite |
||
Line 10:
==Inheritance==
In class-based programming, [[inheritance (object-oriented programming)|inheritance]] is done by defining new classes as [[Extension (semantics)|extensions]] of existing classes: the existing class is the [[parent class]] and the new class is the [[child class]]. If a child class has only one parent class, this is known as ''[[single inheritance]],'' while if a child class can have more than one parent class, this is known as ''[[multiple inheritance]].'' This organizes classes into a [[hierarchy]], either a ''[[Tree (set theory)|tree]]'' (if single inheritance) or ''[[Lattice (order)|lattice]]'' (if multiple inheritance).
The defining feature of inheritance is that both interface and implementation are inherited; if only interface is inherited, this is known as [[interface inheritance]] or ''subtyping.'' Inheritance can also be done without classes, as in [[prototype-based programming]].
==Critique of class-based models==
|