class A
{
void printa()
{
System.out.println("class A");
}
}
class B extends A
{
void printb()
{
System.out.println("class B");
}
}
class C extends A
{
void printc()
{
System.out.println("class C");
}
}
class D extends A
{
void printd()
{
System.out.println("class D");
}
}
class Test
{
public static void main(String[] args)
{
B obj_b = new B();
obj_b.printa();
obj_b.printb();
C obj_c = new C();
obj_c.printa();
obj_c.printc();
D obj_d = new D();
obj_d.printa();
obj_d.printd();
}
}
OUTPUT
Comments
Post a Comment