This is a static class initializer. When the class is loaded, the static initializer starts. This is similar to a constructor, but for a class, not for individual objects.
Several static initializers can be displayed in the class, as well as direct initializers for static variables. They will be combined into one initializer in the order in which they are declared. For example, the following will print โfooโ to stdout whenever the class loads (usually once for the application).
public class Foo {
static String a;
static {
a = "foo";
}
static String b = a;
static {
System.println(b);
}
}