Understanding Inheritance and Different Types of Inheritance

Inheritance

Inheritance is the process of creating a new Class, called the Derived Class, from the existing class, called the Base Class.

The “inheritance concept” can be grouped into two categories:

Different Types of Inheritance

Object-Oriented Programming (OOP) support the six different types of inheritance as given below:

  1. Single Inheritance
  2. Multi-level Inheritance
  3. Multiple Inheritance
  4. Multi-path Inheritance
  5. Hierarchical Inheritance
  6. Hybrid Inheritance
Different types of inheritance

1. Single Inheritance

A derived class (Derived Class) is created from a single base class (Base Class).

2. Multi-level Inheritance

A derived class (Derived Class 2) is created from another derived class (Derived Class 1).

3. Multiple Inheritance

A derived class (Derived Class) is created from more than one base class (Base Class 1, Base Class 2).

4. Multi-path Inheritance

Multi-path inheritance is a method of inheritance in which derivation of a class (Derived Class- D) from other derived classes (Derived Class- B, Derived Class- C) which are derived from the same base class (Base Class – A)

5. Hierarchical Inheritance

Under Hierarchical Inheritance, derived classes (Derived Class-1, Derived Class-2, Derived Class-3) are created from a single base class (Base Class)  is called Hierarchical Inheritance.

6. Hybrid Inheritance

Any combination of above three inheritances (single, multi-level and hierarchical) is called as hybrid inheritance.

Exit mobile version