Sounded to me like this would be something pretty easy to find in the
Java Language Specification. It was.
The JLS indicates that different checks are applied to final variables vs. final fields. For final variable the check is that it
cannot be assigned to unless it is "Definitly
unassigned" (There's a whole section describing what definitely unassigned means if you have questions about that see the (�16) link from section 4.5.4) For final fields compliler checks to make sure that it is definitly
assigned (class variable by a static initializer, instance varibable by the end of the constructor).
8.3.1.2 final Fields
A field can be declared final (�4.5.4). Both class and instance variables (static and non-static fields) may be declared final.
It is a compile-time error if a blank final (�4.5.4) class variable is not definitely assigned (�16.7) by a static initializer (�8.7) of the class in which it is declared.
A blank final instance variable must be definitely assigned (�16.8) at the end of every constructor (�8.8) of the class in which it is declared; otherwise a compile-time error occurs.
4.5.4 final Variables
A variable can be declared final. A final variable may only be assigned to once. It is a compile time error if a final variable is assigned to unless it is definitely unassigned (�16) immediately prior to the assignment.
[ March 25, 2005: Message edited by: Carol Enderlin ]