package day02;
public class PersonImp {
PersonImp(){
System.out.println("加载构造函数");
}
{
System.out.println("加载方法体");
}
static {
System.out.println("加载类方法体");
}
}
结果::
加载类方法体
加载方法体
加载构造函数
package day02;
public class PersonImp {
PersonImp(){
System.out.println("加载构造函数");
}
{
System.out.println("加载方法体");
}
static {
System.out.println("加载类方法体");
}
}
结果::
加载类方法体
加载方法体
加载构造函数