class One
{
One()
{
System.out.println("One");
}
}
class Two extends One
{
Two()
{
System.out.println("Two");
}
}
class Super2
{
public static void main(String args[])
{
Two t=new Two();
}
}
The first line of every constructor is
super();
that is every constructor call its super class constructor first;




No comments:
Post a Comment