0% found this document useful (0 votes)
88 views

Types of Inheritance in C++ - C++ Tutorial - Studytonight

There are 5 types of inheritance in C++: single, multiple, hierarchical, multilevel, and hybrid (also called virtual). Single inheritance allows a derived class to inherit from only one base class. Multiple inheritance allows a derived class to inherit from two or more base classes. Hierarchical inheritance involves multiple derived classes inheriting from a single base class, while multilevel inheritance is when a derived class inherits from a class that also inherits from another class. Hybrid inheritance combines hierarchical and multilevel inheritance.

Uploaded by

Surendar Karnan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views

Types of Inheritance in C++ - C++ Tutorial - Studytonight

There are 5 types of inheritance in C++: single, multiple, hierarchical, multilevel, and hybrid (also called virtual). Single inheritance allows a derived class to inherit from only one base class. Multiple inheritance allows a derived class to inherit from two or more base classes. Hierarchical inheritance involves multiple derived classes inheriting from a single base class, while multilevel inheritance is when a derived class inherits from a class that also inherits from another class. Hybrid inheritance combines hierarchical and multilevel inheritance.

Uploaded by

Surendar Karnan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

(http://www.studytonight.

com/)

SEE THE INDEX

In C++, we have 5 different types of Inheritance. Namely,


1. Single Inheritance
2. Multiple Inheritance
3. Hierarchical Inheritance
4. Multilevel Inheritance
5. Hybrid Inheritance (also known as Virtual Inheritance)

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

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

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

In this type of inheritance the derived class inherits from a class, which in turn inherits from some other class. The Super class for one, is sub class for the
other.

Hybrid Inheritance is combination of Hierarchical and Mutilevel Inheritance.

Prev (overview-of-inheritance.php)

Next (order-of-constructor-call.php)

You might also like