/* ======================================================= File Name : MultiLevelInheritance.java WebSite : http://javaproglang.blogspot.in/ Facebook : https://www.facebook.com/bintu.chaudhary.mks Twitter : https://twitter.com/bintuchaudhary Created By : Bintu Chaudhary ======================================================= */ import java.io.*; class base1 { public void show1() { System.out.println("\n\tBase1 Class"); } } class base2 extends base1 { public void show2() { System.out.println("\n\tDerived Class from Base1 Class"); } } class base3 extends base2 { public void show3() { System.out.println("\n\tDerived Class from base2 Class"); } } class MultiLevelInheritance { public static void main(String args[]) { base3 obj=new base3(); obj.show1(); obj.show2(); obj.show3(); } }
No comments:
Post a Comment