class Person
{
{
System.out.println("构造代码块=a");
}
static
{
System.out.println("静态代码块=a");
}
Person(){
System.out.println("构造方法=a");
}
void show()
{
System.out.println("Person");
}
}
class Student extends Person
{
String name = "aaa";
{
System.out.println("构造代码块=b");
}
static
{
System.out.println("静态代码块=b");
}
Student(){
System.out.println("构造方法=b");
}
void show()
{
System.out.println("Student");
}
}
public class Test
{
public static void main(String[] args)
{
Student p = new Student();
}
}
请问下输出的顺序是什么?为什么 |