27.查看下面代码:
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 |
|