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

来源:互联网 发布:mac 模拟城市4 秘籍 编辑:程序博客网 时间:2024/05/16 05:21


main是Test_02_1类的static方法,按照常理它只能访问Test类中static资源,而class A是非static所以报错了。解决方法很简单,给class A添加static属性就可以了。

static class A{}

阅读全文
0 0