I have googled couple of times but still can\'t understand the supertype method. Can anyone please explain what is this?
Super at Constructer level
class SuperClass
{
int num=10;
public void display()
{
System.out.println("Superclass display method");
}
}
class SubClass extends SuperClass
{
int num=20;
public void display()
{
System.out.println("the value of subclass variable name:"+num);
System.out.println("Subclass display method");
}
public void Mymethod()
{
super.display();
System.out.println("the value of superclass variable name:"+super.num);
}
public static void main(String[] args)
{
SubClass obj=new SubClass();
obj.Mymethod();
obj.display();
}
}