finalをつけておくとコンパイルできます。
(finalでなければコンパイルできません。)
public class Closure
{
class Test{};
Closure()
{
final int i=0;
(new Test()
{
void test()
{
System.out.println(i);
}
}).test();
}
public static void main(String args[])
{
Closure closure=new Closure();
}
}
もちろん値は変更できません。:)