Anybody could explain me why a inner class object can use the local variables of the method the inner class is in when these ones are declared final.
It's confused to get it when you think that the scope of a local variable is limited to the method the variable is declared in. so, any special reason??
Well, technically, it is not using the local variable. If the local variable is final, the inner class can assume that the variable will not change, and hence, make a copy of it.
Thanks Ankit..but i wonder where from do you get all these details(i have read lot of your replys in the forum).. if you could give any resource i think that could help scjp aspirants a lot...
Thanks Ankit..but i wonder where from do you get all these details(i have read lot of your replys in the forum).. if you could give any resource i think that could help scjp aspirants a lot...