16.5. Definite Assignment and Enum Constants
The rules determining when a variable is definitely assigned or definitely unassigned before an enum constant (§8.9.1) are given in §16.8.
This is because an enum constant is essentially a static final
field (§8.3.1.1, §8.3.1.2) that is initialized with a class instance creation expression (§15.9).
• V is definitely assigned before the declaration of a class body of an enum constant with no arguments that is declared within the scope of V iff V is definitely assigned before the enum constant.
• V is definitely assigned before the declaration of a class body of an enum constant with arguments that is declared within the scope of V iff V is definitely assigned after the last argument expression of the ...
Get The Java® Language Specification, Java SE 7 Edition, Fourth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.