thereby making this derived class the base class for the new class. As you can see in below flow diagram C is subclass or child class of B and B is a child class of A. For more details and example refer –Multilevel inheritance in Java. ...
When a class extends a class, which extends anther class then this is calledmultilevel inheritance. For example class C extends class B and class B extends class A then thistype of inheritanceis known as multilevel inheritance. Lets see this in a diagram: It’s pretty clear with the diagra...
In Our Example illustrates Multilevel Inheritance, Here Class B is derived from superclass A which itself acts as a superclass for the subclass C. The class C inherits the members of Class B directly as it is explicitly derived from it, whereas the members of class A are inherited indirectl...
classMyGrandChild:publicMyChild { }; intmain() { MyGrandChild myObj; myObj.myFunction(); return0; } Try it Yourself » Exercise? What is multilevel inheritance in C++? A class inheriting from multiple classes A class that is derived from another derived class ...