In JSL 3.0, chapter 12.4.1 "When Initialization Occurs" it says:
A class or interface type T will be initialized immediately before the first occurrence of any one of the following:
# T is a class and an instance of T is created.
# T is a class and a static method declared by T is invoked.
# A static field declared by T is assigned.
-> # A static field declared by T is used and the field is not a constant variable (§4.12.4).
# T is a top-level class, and an assert statement (§14.10) lexically nested within T is executed.
But what happens if the field is a constant variable?
A test* in the debugger shows, that it is initialized the same, when the field is used.
Can someone clear this up?
* for test I used this code with Sun JRE 1.6.0u17, in Eclipse v3.5.1: