posted 23 years ago
BTW, the output is 5142, not 5152.
I can't see any way for the variable i at //1 to be visible at //2,
The Final modifier lets the inner class access i, it being a local variable inside the method defining the inner class. But as soon as the inner class defines its version of i, the local i at //1 is totally inaccesable (unless you cheat and change it from i to j).
I'd love someone to prove me wrong.