Tarun wants to write code for his computer class homework but he had misheard the teacher and only can recollect remembering this 4 words. Which of the following is what he couldn’t have had heard?
Answer : A. Distributive
- It refers to the concept of one class extending (Or inherits) more than one base class. The inheritance we learnt earlier had the concept of one base class or parent. The problem with “multiple inheritance” is that the derived class will have to manage the dependency on two base classes.
- When a class extends a class, which extends anther class then this is called multilevel inheritance. For example class C extends class B and class B extends class A then this type of inheritance is known as multilevel inheritance.
- When more than one classes inherit a same class then this is called hierarchical inheritance. For example class B, C and D extends a same class A.