/*To show multiple-inheritence*/
import java.lang.*; class A { A() { } void display() { System.out.println("class A"); } } class B extends A { B() { } void display1() { display(); System.out.println("class B"); } } class C extends B { C() { } void display2() { display1(); System.out.println("class C"); } } class multi_inheritance { public static void main(String arg[]) { C c1=new C(); c1.display2(); } }
No comments:
Post a Comment