Multilevel Inheritance In Java
With Example Programs
Multilevel Inheritance
In single inheritance we have only one parent class and one child class but multilevel inheritance the child class again have subclasses.This technique is called multilevel inheritance
For example, if A, B and C are three classes, we can inherit class B to class A and class C to class B using extends keyword. Also, if we create a C class object, we can access the properties of all three classes. We can limit the object creation in inheritance.This is the advantage of inheritance.
Comments
Post a Comment