I am trying to run this code, I but found out this behavior of final with static: the code runs without executing static block of A. Please provide me with the reason.
class A {
final static int a=9;
static { //this block is not executing ??
System.out.println("static block of A");
}
}
class Manager {
static {
System.out.println("manager sib");
}
public static void main(String ...arg) {
System.out.println("main");
System.out.println(A.a);
}
}
Why doesn't the static block of Class A run?