刚刚写一段代码
报这样的错误:
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的,问题就解决了。
时间: 2024-12-21 17:12:14