Anatolii Shuba

Greenhorn
+ Follow
since Feb 22, 2018
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Anatolii Shuba

Mike Simmons wrote:
it should say:

2. Process all static variable declarations and static initializers in the order they appear


Your code demonstrates this.  Also, the Java Language Specification backs us up:

JLS 16 12.4.2 wrote:9. Next, execute either the class variable initializers and static initializers of the class, or the field initializers of the interface, in textual order, as though they were a single block.




Now it is clear for me. Thanks!
Code output is "1" but according to the  OCP STUDY GUIDE it should be "2". Just double checked using OpenJDK v.11.0.11+9-Ubuntu-0ubuntu2.20.04

Sorry but I still dont understand why code output doesnt correspond to OCP STUDY GUIDE