public class A { public class Inner { public Inner(){ } } } A.Inner b = new A.Inner();
内部类创建对象时提示 is not an enclosing class 错误
解决方法:内部类加上static 声明
public static class Inner { }
public class A { public class Inner { public Inner(){ } } } A.Inner b = new A.Inner();
内部类创建对象时提示 is not an enclosing class 错误
解决方法:内部类加上static 声明
public static class Inner { }
发表评论