Static blocks may occur in
class bodies. Static blocks are executed once, when the class is defined.
They can be used to initialize static variables.
Syntax:
static {
statements
}
Example:
class A {
static var b : Date;
static {
b = new Date;
}
}
See also: Static methods