class Base
{
void show()
{
System.out.println("Base class show function");
}
}
class Derive extends Base
{
void show()
{
super.show(); ------------------------------------------ IT CALLS THE BASE CLASS
System.out.println("Derive class show function");
}
}
class Example
{
public static void main(String args[])
{
Derive d=new Derive();
d.show();
Base b=new Base();
b.show();
}
}
{
void show()
{
System.out.println("Base class show function");
}
}
class Derive extends Base
{
void show()
{
super.show(); ------------------------------------------ IT CALLS THE BASE CLASS
System.out.println("Derive class show function");
}
}
class Example
{
public static void main(String args[])
{
Derive d=new Derive();
d.show();
Base b=new Base();
b.show();
}
}
No comments:
Post a Comment