标题: 大家帮忙看看了 [打印本页] 作者: why910107 时间: 2016-6-11 22:06 标题: 大家帮忙看看了 class A {
public int i = 10;
}
class B extends A{
public int i = 20;
}
public class Test{
public static void main(String args[]){
B b = new B();
A a = b;
System.out.println(b.i);
System.out.println(a.i);
}
}
输出为多少 ( )
A.10 10
B.10 20
C.20 10
D.20 20