关于JAVA内部类的问题
public class OuterClass {
private class InterClass
{
public InterClass() {
System.out.println("InterClass maoth");
}
//为什么大括号里的先执行呀,不是构造方法先执行吗?
{
System.out.println("InterClass Create");
}
}
public OuterClass()
{
InterClass ic = new InterClass();
System.out.println("OuterClass Create");
}
public static void main(String[] args)
{
OuterClass oc = new OuterClass();
}
}
刚刚接触内部类对里面的代码有点不太明白