标题: java+android新手 [打印本页] 作者: 遗忘的青春年华 时间: 2014-3-4 23:15 标题: java+android新手 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);
}
}