Static block vs. initializer block in Java? [duplicate]
They’re for two very different purposes: The static initializer block will be called on loading of the class, and will have no access to instance variables or methods. As per @Prahalad Deshpande’s comment, it is often used to create static variables. The non-static initializer block on the other hand is created on object construction only, … Read more