3.6.10.A local variable or method parameter must be declared final if it is to be used by an inner class declared inside a method.
public class MainClass { public static void main(String[] argv) { int i = 0;
class MyClass { void m() {
System.out.println(i);
}
}
}
}
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Cannot refer to a non-final variable i inside an inner class defined in a different method
at MainClass.main(MainClass.java:8)