class Dome9{
int x=3;
void method(final int a){
final int y=6;
class Dome8{
void method2(){
System.out.print(x);
System.out.print(a);
System.out.print(y);
}
}
new Dome8().method2();
}
}
class Test {
public static void main(String[] args) {
new Dome9().method(8);
}
}
输出:386
jdk1.8 去掉2个final输出依旧:386 |
|