public class outer
{
private int size;
public class Inner
{
private int size;
public void doStuff(int size)
{
size ++;//内部类自定义属性size++
this.size++;//传入的参数this.size = size 此size++
outer.this.size++;//类名调用外部类属性size++
}
}
}
等同于
public class outer
{
private int size1;
public class Inner
{
private int size2;
public void doStuff(int size3)
{
size2 ++;
size3++;
Oute. size1++;
}
}
}
我这样理解 不知道对不对 |