class A
{
void dis()
{
System.out.println("From A");
}
}
class B extends A
{
void dis()
{
System.out.println("From B");
}
}
class C extends B
{
void dis()
{
System.out.println("From C");
}
}
class He
{
public static void main(String ar[])
{
A i;
i=new A();
i.dis();
i=new B();
i.dis();
i=new C();
i.dis();
}
}
Output:
{
void dis()
{
System.out.println("From A");
}
}
class B extends A
{
void dis()
{
System.out.println("From B");
}
}
class C extends B
{
void dis()
{
System.out.println("From C");
}
}
class He
{
public static void main(String ar[])
{
A i;
i=new A();
i.dis();
i=new B();
i.dis();
i=new C();
i.dis();
}
}
Output:
Comments
Post a Comment
If you have any query, please let us know