/**
* @(#)InitializeOrderTest.java
*
* 初始化順序
* @author CplusHua
* @version 1.00 2013/5/15
*/
public class InitializeOrderTest {
public static String staticField="靜態變量";
public String field="變量";
static{
System.out.println("staticField");
System.out.println("靜態初始化塊");
}
{
System.out.println(field);
System.out.println("初始化塊");
}
public InitializeOrderTest() {
System.out.println("構造方法");
}
public static void main(String[] args){
new InitializeOrderTest();
}
}
//--------------------Configuration: <Default>--------------------
//staticField
//靜態初始化塊
//變量
//初始化塊
//構造方法
//
//Process completed.