// When the class is loaded, the static block gets executed
public class Program {
static int a;
static int b;
static int c;
//static block1
static {
System.out.println("static block 1");
a = 111;
}
//static block2
static {
System.out.println("static block 2");
b = 222;
}
//static block3
static {
System.out.println("static block 3");
c = 333;
}
public static void main(String[] s) {
System.out.println(a + " " + b + " " + c);
}
}
/*
run:
static block 1
static block 2
static block 3
111 222 333
*/