No enclosing instance of type xxx.class(你的类) is accessible. Must qualify the allocation with an enclosing instance of type xxx.class(你的类) (e.g. x.new A() where x is an instance of xxx.class(你的类)).
出现以上错误的原因:
public class One{
public static void main(String []args){
Two mTwo= new Two();
}
class Two{
}
}
注意你以上的方括号,在类One中,是包括Two类的,所以会出现以上的报错。
解决方法为:
public class One{
public static void main(String []args){
Two mTwo = new Two();
}
}
class Two{
}
把Two移除One类即可。