class InnerDemo
{
public static void main(String[] args)
{
Outer.Inner in=new Outer().Inner();
in.function();
}
}
class Outer
{
private int x=3;
class Innter
{
int x=4;
void function()
{
int x=6;
System.out.println("inner:"+this.x);
}
}
void method()
{
Inner in=new Inner();
in.function();
}
}
内部类中这个this.x为什么是4,this不是代表对象吗 |
|