Static blocks or static initializers initialize static fields in Java. We declare static blocks when we intend to initialize static fields within our class. Static blocks execute precisely once when the class is loaded. They are executed even before the constructors are executed.