//https://csprograms4u.blogspot.com/
//Chapter 5
//Program 2
//Multilevel
Inheritance
public
class A
{
public void a1()
{
System.out.println("Class
A");
}
}
public
class B extends A
{
public void b1()
{
System.out.println("Class
B");
}
}
public
class C extends B
{
public void c1()
{
System.out.println("Class
C");
}
public static void main(String args[])
{
C obj=new C();
obj.a1();
obj.b1();
obj.c1();
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.