public static void main(String[] args) {
Outer1 ou = new Outer1();
ou.show();
}
}
class Outer1 {
int b = 10;
void show() {
final int b = 20;
class Inner1 {
int b = 30;
void method() {
int b = 40;
System.out.println(new Outer1().b);//外部类的b
System.out.println();//可以打印b=20么?
System.out.println(this.b);//局部内部类的b
System.out.println(b);//局部内部类方法中的b
}
}
Inner1 in = new Inner1();
in.method();
}
|
|