Types of Inheritance

C++ supports five types of inheritance:

1.Single level Inheritance
2.Multilevel Inheritance
3.Multiple Inheritance
4.Hybrid Inheritance
5.Hierarchial Inheritance

1.Single inheritance :
       Is defined as the inheritance in which a derived class is inherited from the only one base class.


Where 'A' is the base class, and 'B' is the derived class.

2.Multilevel Inheritance:
Multilevel inheritance is a process of deriving a class from another derived class. 


When one class inherits another class which is further inherited by another class, it is known as multi level inheritance in C++. Inheritance is transitive so the last derived class acquires all the members of all its base classes.

3.Multiple Inheritance:
Multiple inheritance is the process of deriving a new class that inherits the attributes from two or more classes.


4.Hybrid Inheritance:
Hybrid inheritance is a combination of more than one type of inheritance.



5.Hierarchical Inheritance
Hierarchical inheritance is defined as the process of deriving more than one class from a base class


Posted on by