class Father {
int m = 5;
public Father() {
this.show();
}
void show() {
System.out.println("父");
}
}
class Child1 extends Father {
int m = 10;
void show() {
System.out.println("Child1:"+m);
}
}
class Child2 extends Father {
void show() {
System.out.println("Child2:"+m);
}
}
public class Test {
public static void main(String args[]) {
Father n = new Child1();
Father n1 = new Child2();
}
}