{
System.out.println("这是测试类的构造代码块");
}
public static void main(String[] args) {
{
System.out.println("测试类的在对象前的局部代码块");
}
//在这个地方创建一个子类对象,用来测试创建对象的执行流程
Son son = new Son();
System.out.println("----------------------------------------------");
Son son2 = new Son("小易");
{
int x = 100;
System.out.println("这是测试类的局部代码块" + x);//局部代码块的作用是为了控制局部变量的生命周期,提早释放内存;
}
}
}