本帖最后由 城市儒侠 于 2013-12-17 19:35 编辑
看了N遍。怎么就有错误呢。 很晕。搞不定。
class Outer {
private int x = 3;
class Inner
{
int x = 4;
void function()
{
int x = 5;
System.out.println(x);
System.out.println(this.x);
System.out.println(Outer.this.x);
}
}
void method()
{
Inner in = new Inner();
in.function();
}
}
public class Outer1 {
public static void main (String args []) {
Outer out = new Outer();
out.method();
Outer.Inner in = new Outer.new Inner();
in.function();
}
}
|