Based on the number of child and parent classes, inheritance can be classified into five different types. Namely:
- Single Inheritance
- Hierarchical Inheritance
- Multiple Inheritance
- Multilevel Inheritance
- Hybrid Inheritance
*1. Single Inheritance *
One parent class gets inherited in only one child class.
*2. Hierarchical Inheritance *
One parent class gets inherited in multiple child classes.
*3. Multiple Inheritance *
Multiple parent classes are inherited in only one. child class.
*4. Multilevel Inheritance *
One parent class is inherited by an intermediate class, which in turn is inherited by another child class.
*5. Hybrid Inheritance *
A class that has a combination of different types of classes.
Top comments (0)