Wednesday, 9 July 2014

What is Multilevel Inheritance

First take a look on this picture because I believe 'Picture contain Thousand words" ; so look at this picture


In above the Class A is super class and class B is child class of class A and Class C is child of Class B, but class C also absorb the capability of Class B as well as class class A.

Here is the example of  Java code

     public class A{

     }
     public class B extends A{

     }
     public class C extends B{

     }


There are much more difference between multilevel and multi inheritance, lets take another look 
 


public class Employee{
}


public class OfficeStaff extends Employee{
}


public class Cashier extends OfficeStaff{
}




No comments:

Post a Comment