Difference between Single Inheritance and Multiple Inheritance

S.NO Single Inheritance Multiple Inheritance
1. Single inheritance is one in which the derived class inherits the single base class. Whereas multiple inheritance is one in which the derived class acquires two or more base classes.
2. In single inheritance, the derived class uses the features of the single base class. While in multiple inheritance, the derived class uses the joint features of the inherited base classes.
3. Single inheritance requires a small run time as compared to multiple inheritance due to less overhead. While multiple inheritance requires more run time as compared to single inheritance due to more overhead.
4. Single inheritance is a lot close to specialization. In contrast, multiple inheritance is a lot close to generalization.
5.

Single inheritance is implemented as

Class DerivedClass_name : access_specifier Base_Class{};

.

Multiple inheritance is implemented as

Class DerivedClass_name : access_specifier Base_Class1, access_specifier Base_Class2, ….{};

.

6. Single inheritance is simple in comparison to multiple inheritance. While multiple inheritance is complex in comparison to single inheritance.
7. Single inheritance can be implemented in any programming language. C++ supports multiple inheritance but multiple inheritance can’t be implemented in any programming language(C#, Java doesn’t support multiple inheritance).
8. Single inheritance constructs an inheritance tree. Multiple inheritance constructs Inheritance Directed Acyclic Graph (DAG).

Related Articles:



Difference between Single and Multiple Inheritance in C++

Similar Reads

Single Inheritance

Single inheritance is one in which the derived class inherits the single base class either public, private, or protected access specifier. In single inheritance, the derived class uses the features or members of the single base class. These base class members can be accessed by a derived class or child class according to the access specifier specified while inheriting the parent class or base class....

Multiple Inheritance

...

Difference between Single Inheritance and Multiple Inheritance

Multiple inheritance is one in which the derived class acquires two or more base classes. In multiple inheritance, the derived class is allowed to use the joint features of the inherited base classes. Every base class is inherited by the derived class by notifying the separate access specifier for each of them....