[java]代码库
public class Test {
/*private static HashMap<String, String> map = new HashMap<String, String>() {
{
put("Name", "June");
put("QQ", "2572073701");
}
};*/
public Test() {
System.out.println("Constructor called:构造器被调用");
}
static {
System.out.println("Static block called:静态块被调用");
}
{
System.out.println("Instance initializer called:实例初始化块被调用");
}
public static void main(String[] args) {
new Test();
System.out.println("=======================");
new Test();
}
}//源代码片段来自云代码http://yuncode.net