public class SmartBoy extends Person {
SmartBoy(String name,int age){
super(name,age);
}
public static void main (String[] args) {
PretyGirl p;
p = new PretyGirl("Ann");
System.out.println(p);
}
}
public class PrettyGirl extends Person {
PrettyGirl(String name,int age){
super(name,age);
}
public static void main (String[] args) {
System.out.println("Name : Ann");
System.out.println("Age : 19");
}
}
3. class SmartBoy
public class SmartBoy extends Person {
SmartBoy(String name,int age){
super(name,age);
}
public static void main (String[] args) {
PrettyGirl pg;
pg = new PrettyGirl("Ann my girlfriend",19);
System.out.println("Name : Boh");
System.out.println("Age : 20");
System.out.println(pg);