public class SuperClass
{
public SuperClass(String name)
{
System.out.println("Inside SuperClass(String name) constructor. ");
System.out.println("name = "+name);
}
public SuperClass(String name,int age)
{
System.out.println("Inside SuperClass(String name,int age) constructor. ");
System.out.println("name = "+name);
System.out.println("age = "+age);
}
}
SubClass.java public class SubClass extends SuperClass
{
public SubClass(String name)
{
super(name);
System.out.println("Inside SubClass(String name) constructor. ");
}
public SubClass(String name,int age)
{
super(name,age);
System.out.println("Inside SubClass(String name,int age) constructor. ");
}
}