Differentiate between multiple and multilevel inheritance.
Answers
Multiple Inheritance vs Multilevel Inheritance
Multiple Inheritance is an Inheritance type where a class inherits from more than one base class.Multilevel Inheritance is an Inheritance type that inherits from a derived class, making that derived class a base class for a new class. UsageMultiple Inheritance is not widely used because it makes the system more complex.Multilevel Inheritance is widely used.Class LevelsMultiple Inheritance has two class levels namely, base class and derived class.Multilevel Inheritance has three class levels namely, base class, intermediate class and derived class.
Differences between multiple and multilevel inheritance are:-
1) Multiple inheritance is a inheritance of minimum two or more than two characters at same time from parents to progeny whereas multilevel inheritance is inheritance of one character from parents to many levels of progeny that is from parents to F1 and from F1 to F2 and so on.
2)In multiple inheritance two or more characters are transferred from parents to progeny and in multilevel inheritance one character is passed from parents to successive progenies.
3)Example of multiple inheritance is in pea plant the colour of pod and size of pod are transferred from parents to progeny at same time.
4) Example of multilevel inheritance is height character passed from parents to F1 and then to F2 ,similar example is inheritance of blood group eye colour from parents to successive progenies.