用 eclipse 写 Java 代码时出现了这个问题,详细如下:

No enclosing instance of type TestParsingLinkedList is accessible. Must qualify the allocation with an enclosing instance of type TestParsingLinkedList (e.g. x.new A() where x is an instance of A).

其中 A 为类名。

 

原因:原来是静态方法中不能创建动态内部类的对象。

解决方法:将类改为 static, 或将方法改为非静态的。

 

参考:http://blog.csdn.net/sunny2038/article/details/6926079

相关文章:

  • 2022-12-23
  • 2021-11-17
  • 2021-08-15
  • 2021-09-08
  • 2022-12-23
  • 2022-01-23
  • 2021-06-30
猜你喜欢
  • 2021-06-02
  • 2021-07-24
  • 2021-05-24
  • 2021-08-16
  • 2022-12-23
  • 2021-08-05
  • 2022-02-03
相关资源
相似解决方案