C++ Types of Inheritance

Advertisements

C++ Inheritance Types

C++ supports six types of inheritance as follows:

  • Single Inheritance
  • Multilevel Inheritance
  • Multiple Inheritance
  • Heirarchical Inheritance
  • Hybrid Inheritance
  • Multipath Inheritance

Single Inheritance

A derived class with only one base class is called single inheritance.




Multilevel Inheritance

A derived class with one base class and that base class is a derived class of another is called multilevel inheritance.




Multiple Inheritance

A derived class with multiple base class is called multiple inheritance.




Heirarchical Inheritance

Multiple derived classes with same base class is called hierarchical inheritance.




Hybrid Inheritance

Combination of multiple and hierarchical inheritance is called hybrid inheritance.




Multipath Inheritance

A derived class with two base classes and these two base classes have one common base class is called multipath inheritance.More info.




Advertisement