I am confused with the output of the below code. I know first static block gets executed after class loading but why is my class Test6 not getting loaded. Can someone please clarify.
package com.vikash.General;
public class Test5 {
public static void main(String[] args) {
System.out.println(Test6.FOO);
}
static {
System.out.println("Initializing B");
}
}
class Test6{
public static final String FOO = "foo";
static {
System.out.println("Initializing A");
}
}