java内部类
public class Outer {
private int index = 100;
public void func(final int a) {
final int b = 0;//只有 fianl 才可以被函数里面的内部类访问
class Middle {
private int index = 101;
class Inner {
private int index = 103;
void print() {
int index = 104;
System.out.println(index);
System.out.println(this.index);
System.out.println(Middle.this.index);
System.out.println(Outer.this.index);
System.out.println(a);
System.out.println(b);
}
}
}
}
}
private int index = 100;
public void func(final int a) {
final int b = 0;//只有 fianl 才可以被函数里面的内部类访问
class Middle {
private int index = 101;
class Inner {
private int index = 103;
void print() {
int index = 104;
System.out.println(index);
System.out.println(this.index);
System.out.println(Middle.this.index);
System.out.println(Outer.this.index);
System.out.println(a);
System.out.println(b);
}
}
}
}
}