This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Hi. Below is from geekevaluation.com, regarding method local inner class. I know that final variables of methods can only be accessed by its method local inner class. Then why not in below mentioned code?
Here 'a' is a final variable. Still at Line 4, there is a compiler error. Somebody please give me a proper explanation for this. Thanks.
1. Within a class definition only declarations of variables, methods, blocks, etc. are allowed, but no statements like "a = 19;". The follwing example will help: 2. You can't assign a value to a final variable within a local class.