Test your Programming knowledge

50% users failed to get the best score. It's your turn to test now.
Questions curated by the expert mentors at codzify.com

Start Quiz

Article

Types of Inheritance in C++

5 min 25 sec read

Types of Inheritance

There are various types of inheritance in C++ . You can derive your class in different ways as follows :

1) Single Level Inheritance :-

In this type of inheritance , only one class can be derived from base class.

 

2) Multi Level Inheritance :-

 

In this type of inheritance, one class is derived from base class and that derived class is a base class for another derived class. In this there can be multiple levels of Derived classes.

 

3) Hierarchical Inheritance

 

If multiple classes are derived from one base class then such type of inheritance is called as hierarchical inheritance.

 

4) Multiple Inheritance :-

 

If a single class is derived from multiple base classes then such type of inheriatnce is called as Multiple inheritance.

 

5) Hybrid Inheritance :-

 

This is mixed type of inheritance. It includes multilevel , multiple , hierarchical inheritance.

Recommended Articles

Did you found this article helpful?

Try to execute what you have learnt

Easy to use online data structure compiler where you can execute the programs in your favourite programming language.
(C, C++, Python)

Open Compiler

HTML, CSS and Javascript Real time Web Editor

Execute your HTML, CSS and javascript code in real time with the web editor
(HTML, CSS, Bootstrap, Javascript)

Open Web Editor