class Demo_Extends1 {
public static void main(String[] args) {
System.out.println("Hello World!");
C c = new C();
c.show();
}
}
class A {
public void show() {
show2();
}
public void show2() {
System.out.println("我");
}
}
class B extends A {
public void show2() {
System.out.println("ai");
}
}
class C extends B {
public void show() {
super.show();
}
public void show2() {
System.out.println("你");
}
} |
|