No enclosing instance of type Face is accessible. Must qualify the allocation with an enclosing inst

刚才在练习内部类的时候遇到了这个报错:

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

意思大概是没有可访问的内部类的实例

我这里忘了放代码,只记得是往内部类前面加个static成为静态就好了。

猜你喜欢

转载自blog.csdn.net/dyy0920/article/details/84777937