问下关于java静态方法的问题
public class SecondClass {
static FirstClass fc1 = new FirstClass(1);
FirstClass fc3 = new FirstClass(3);
static{
FirstClass fc2 = new FirstClass(2);
}
{
System.err.println("SecondClass's block, this block is not static block.");
}
SecondClass(){
System.err.println("SecondCalss");
}
FirstClass fc4 = new FirstClass(4);
}
如果实例化这个方法:是fc3 先实例还是fc4 先实例,我感觉不应该有先后,还有这个无名的方法{
System.err.println("SecondClass's block, this block is not static block.");
} 应该如何解释,静态的无名方法又该如何解释: static{
FirstClass fc2 = new FirstClass(2);
}
谢谢