|
1
|
- Inheritance is a mechanism in OOP to design two or more entities that
are different but share many common features.
- Features common to all classes are defined in the superclass.
- The classes that inherit common features from the superclass are called
subclasses.
- We also call the superclass an ancestor and the subclass a descendant.
|
|
2
|
- Here are the superclass Account and its subclasses Savings and Checking.
|
|
3
|
- An example of inheritance hierarchy among different types of students.
|