Static initialization of the final field from the static initializer

Why can't I access static end fields from the corresponding static initializer using the declaration class as a classifier (in a static way)?

At first I thought it was an Eclipse error:

Eclipse bug?

I also had some knowledge flaws because static initializers are not my daily business. But now, this works without a class qualifier, as expected:

Lack of knowledge?

To complete my test series, I tried it in bash:

Damn!

causing the same result.

This leads me to the final question:

Is there a reason to prohibit the classifier when accessing static final fields from static initializer blocks? Since the declaration class has not been initialized before?

+4
2

, . , - .

java

" , , . , , , , . Java , , , ."

+1

.

( ), . , ( ) final. , . . .

- Test.I, , , (.. ). , , , , , Test be it Foo.

, , , , final.

, , , , , .

+4

All Articles