class A {
void fun1() {
System.out.println(fun2());
}
int fun2() {
return 123;
}
}
public class B extends A {
int fun2() {
return 456;
}
public static void main(String args[]) {
B b = new B();
b.fun1();
A a = b;
a.fun1();
}
}作者: Imp_x 时间: 2015-2-11 23:15