实例:
public class Child extends Children {
public Child(String name) {
super(name);
}
public void printName() {
System.out.println(super.getName());
}
public static void main(String[] args) {
Child boy = new Child("Charley");
System.out.println(boy.getName());
Child girl = new Child("Queenie");
girl.printName();
}
}
abstract class Children {
private String name;
public Children(String name) {
this.name = name;
}