标签:java
刚刚写一段代码
报这样的错误:
No enclosing instance of type Bag is accessible. Must qualify the allocation with an enclosing instance of type Bag (e.g. x.new A() where x is an instance of Bag).
代码预览:
这句报错:
Maomao mm = new Maomao();
把Maomao这个类改成static的,问题就解决了。
标签:java
原文地址:http://blog.csdn.net/lyy98521/article/details/44873821