为什么下面两段代码中静态代码块、构造代码块和构造函数的执行顺序完全不一样呢?
public class test3 {
public static test3 t1=new test3();
public test3(){
System.out.println("A");
}
{
System.out.println("B");
}
static
{
System.out.println("C");
}
public static void main(String [] args){
//test3 t2=new test3();
}
}
public class test3 {
//public static test3 t1=new test3();
public test3(){
System.out.println("A");
}
{
System.out.println("B");
}
static
{
System.out.println("C");
}
public static void main(String [] args){
test3 t2=new test3();
}
}