What is multiple inheritance? What is multilevel inheritance? What is difference between them?
Multiple Inheritance: When A derived class is derived from more than one base class then it is known as multiple inheritance. A derived class can inherit the attributes of all base classes from which it is derived.
Multi-level Inheritance: - When a derived class is derive from a intermediate base class which in turn derived from another base class then this type of inheritance is known as multi level inheritance. The derived class can inherit properties of base classes from each level.
Difference:
Multiple Inheritance
|
Multi-Level Inheritance
|
In this there exists more than one base class to derived class.
|
In this type of inheritance there exists only one base class to derived class.
|
It does not have intermediate class.
|
It has intermediate class.
|
It can go up to only one level.
|
It can go up to any level based on programming need.
|
The derived class inherits some property of all base classes.
|
In this, last derived class will inherit only public property of all class including intermediate class.
|