Child extends Parent
Animal.java
Tiger.java
Chicken.java
Animal.java
public class Animal {
String name;
int legs;
String getInfo() {
return name + ", " + legs;
}
}
public class Tiger extends Animal {
}
public class Chicken extends Animal {
int wings;
@Override
String getInfo() {
return name + ", " + legs + " legs, " + wings + " wings";
}
}