C++: Inheritance |Different forms of inheritance

Hybrid inheritance

Hybrid inheritance is a combination of two or more inheritances.


A & B: single inheritance
B,C & D: Multiple inheritances


A &B : Single inheritance
C & D : Single inheritance
B,D & E : multiple inheritance


A,B,C: hierarchical inheritance
B,C,D : Multiple inheritances

From the above figure we have

Class “D” inherits the properties of class “A” two times firstly through class “B” and secondly through class “C”.

Multipath inheritance

When a class inherits the properties of another class through two or more different paths then, it is known as multipath inheritance.