Presentation is loading. Please wait.

Presentation is loading. Please wait.

Types of Inheritance in C++. In C++ we have 5 different types of inheritance: – Single Inheritance – Multiple Inheritance – Hierarchical Inheritance –

Similar presentations


Presentation on theme: "Types of Inheritance in C++. In C++ we have 5 different types of inheritance: – Single Inheritance – Multiple Inheritance – Hierarchical Inheritance –"— Presentation transcript:

1 Types of Inheritance in C++

2 In C++ we have 5 different types of inheritance: – Single Inheritance – Multiple Inheritance – Hierarchical Inheritance – Multilevel Inheritance – Hybrid Inheritance (also known as Virtual Inheritance)

3 Single Inheritance

4 In this type of inheritance one derived class inherits from only one base class. It is the most simplest form of inheritance.

5 Multiple Inheritance

6 In this type of inheritance a single derived class may inherit from two or more than two base classes.

7 Hierarchical Inheritance

8 In this type of inheritance, multiple derived classes inherit from a single base class.

9 Multilevel Inheritance

10 In this type of inheritance, the derived class inherits from a class, which in turn inherits from some other class. The Superclass for one is the Subclass for another.

11 Hybrid (Virtual) Inheritance

12 Hybrid inheritance is combination of Hierarchical and Multilevel Inheritance.


Download ppt "Types of Inheritance in C++. In C++ we have 5 different types of inheritance: – Single Inheritance – Multiple Inheritance – Hierarchical Inheritance –"

Similar presentations


Ads by Google