What is the difference between multiple and multilevel inheritance?

Multiple InheritanceMultilevel Inheritance
Multiple inheritance comes into picture when a class inherits more than one base classMultilevel inheritance means a class inherits from another class which itself is a subclass of some other base class
Example: A class defining a child inherits from two base classes Mother and FatherExample: A class describing a sports car will inherit from a base class Car which inturn inherits another class Vehicle

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *