看程序写结果
class Demo2 {
public static void main(String[] args) {
Man m=new Man();
}
}
class person {
static {
System.out.println("a");
}
{
System.out.println("b");
}
public person() {
System.out.println("c");
}
}
class Man extends person {
static {
System.out.println("d");
}
{
System.out.println("e");
}
public Man() {
System.out.println("f");
}
}
为什么运行的结果是a-d-b-c-e-f