OOAD Princhiples Q/A #2


Question:What is the difference between Multilevel and Muliple Inheritance?

Answer:

Sr. No.Multilevel InheritanceMultiple Inheritance
1In multilevel inheritance, features of only one base class are allowed in derived class.In multile inheritance, features of several classes can be clubbed in a derived class.
2It consists of many levels of inheritance.It consists of only two levels of inheritance.
3A class can be derived from already derived class as shown below. Multilevel Inheritance A class can be derived from multiple classes as shown below. Multiple Inheritance
4Syntax is
class x {}
class y: visibility_control x {}
class z: visibility_control y {}
Syntax is
class x {}
class y {}
class z: visibility_control x, visibility_control y {}
Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements