This is because of the order of initialization of static members - blocks, variables etc.
The cache class gets loaded and all of its static code is executed at that time. Static initializers are executed at the same time that static variables are initialized. The initializations occur in lexical order.
So this gives your first output line:
Initialized Called->false
Over here, the first thing is the static block that calls the static method initializeIfNecessary() which has reference to the 2 variables, declared static. So default values are taken here and code is executed. In the second step it goes for next static member -> sum, for which the values has already been calculated.
Then comes the boolean member and its value is rewritten to false.
If you omit out this assignment of false, you will see that value - true set during initializeIfNecessary() is retained.
Hence your other 2 outputs.