大概情况就是这样一段代码报错,查找资料解决,这里记录一下
public class Test1 {
class A{
}
public static void main(String[] args) {
/**
*报错:
No enclosing instance of type Test1 is accessible. Must qualify the allocation with an enclosing instance of type Test1 (e.g. x.new A() where x is an instance of Test1).
*/
A a =new A();//这里报错,把A 改下 static 的就可以
}
}
参考
非常感谢