class Jsuper
{
public void show()
{
System.out.println("\nThis is from SUPER class");
}
}
class Jsub extends Jsuper
{
public void show()
{
System.out.println("\nThis is from SUB class");
super.show(); // calling the function from parent class
}
}
class JsuperTest
{
public static void main(String args[])
{
Jsub ob=new Jsub();
ob.show();
}
}
Comments
Post a Comment