posted 20 years ago
Excerpt form SYBEX Java 2 Certification:
�Any variable, either local variable or a formal parameter can be accessed by methods within an inner class provided that variable is marked final. A final variable is effectively a constant so this might seem to be a quite severe restriction, but the point is simply this: An object created inside a method is likely to outlive the method invocation. Because local variables and method arguments are conventionally destroyed when their method exists, these variables would be invalid for access by inner class methods after the enclosing method exits. By allowing access only to final variables, it becomes possible to copy the values of those variables into the object itself, thereby extending their lifetimes.�
>R