public class B {
public static B t1 = new B();
public static B t2 = new B();
public B(){
System.out.println("构造方法");
}
{
System.out.println("构造块");
}
static{
System.out.println("静态块");
}
public static void main(String[] args) {
B t = new B();
}
}
执行结果:
构造块, 构造方法,构造块,构造方法,静态块,构造块,构造方法