What do you mean by multiple inheritance and multilevel inheritance? Differentiate between them.

Showing Answers 1 - 1 of 1 Answers

samiksc

  • Jan 23rd, 2006
 

Multiple inheritance refers to a class being derived from two or more classes.

Multilevel inheritance refers to a class inheriting from a parent class which is itself derived from another class.

Multilevel inheritance is supported by all OOPs languages. Multiple inheritance is supported by C++, but not by Java and C#. Java and C# recommend that instead of multiple inheritance the design should be inheriting from one class and implementing other interfaces.

This solves the problems of having to declare 'virtual base classes' as in C++ which arises out of multiple copies of uppermost base class object in a class at inheritance level 3 onwards.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions