public class TestOrder {
// 靜態變量
public static TestA a = new TestA();
// 靜態初始化塊
static {
System.out.println("靜態初始化塊");
}
// 靜態變量
public static TestB b = new TestB();
public static void main(String[] args) {
new TestOrder();
}
}
class TestA {
public TestA() {
System.out.println("Test--A");
}
}
class TestB {
public TestB() {
System.out.println("Test--B");
}
}