class A
{
private int i = 2;
public A()
{
fun();
}
public void fun ()
{
System.out.println(i);
}
}
class B extends A
{
private int i = 22;
public B()
{
i = 222;
}
public void fun()
{
System.out.println(i);
}
}
public class Test
{
public static void main(String[] args)
{
B b = new B();
}
}
这个代码绕的有点变态,大家说出自己的答案和运算步骤。
|