Take, for example, this class:
public class Example {
static {
// Do something
}
}
When exactly is the static block called?
The static initializer block is called once, when the class is initialized. It is generally used to initialize static members of the class.