[Error]No enclosing instance of type XX is accessible. Must qualify the allocation with an e
来源:互联网 发布:上海知恩服饰有限公司 编辑:程序博客网 时间:2024/05/01 15:02
错误原因:
因为xx是一个动态的内部类,创建这样的对象必须有实例与之对应,程序是在静态方法(如pubilc static main函数的方法)中直接调用动态内部类会报这样错误。
解决方法:
1.可以把该内部类声明为static。
2.或者不要在静态方法中调用。
3.定义在含静态方法的类之外;
参考链接:http://blog.sina.com.cn/s/blog_4b93170a0102dx76.html
0 0
- [Error]No enclosing instance of type XX is accessible. Must qualify the allocation with an e
- No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing instanc
- No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing instanc
- No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing insta
- No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing instanc
- No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing instanc
- No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing instanc
- No enclosing instance of type E is accessible. Must qualify the allocation with an en
- [Java]Error:No enclosing instance of type E is accessible. Must qualify the allocation with an enclo
- - No enclosing instance of type Test is accessible. Must qualify the allocation with an enclosing in
- No enclosing instance of type Monster is accessible. Must qualify the allocation with an enclosing i
- No enclosing instance of type ChuangKou is accessible. Must qualify the allocation with an enclosing
- No enclosing instance of type X is accessible. Must qualify the allocation with an enclosing
- No enclosing instance of type X is accessible. Must qualify the allocation with an enclosing instanc
- No enclosing instance of type Test is accessible. Must qualify the allocation with an enclosing inst
- java反射机制之基础
- 我和敏捷开发的故事--敏捷角色PO
- 利用json转变Python格式
- OpenGL GLSL
- 删数问题-注意贪心策略-不严格
- [Error]No enclosing instance of type XX is accessible. Must qualify the allocation with an e
- 暑假-二分图-D - Uncle Tom's Inherited Land
- 问题
- OC中如何进行多文件开发?
- iOS——创建Xcode 的Hello World
- 做葡萄酒全过程
- Linux/ubuntu 截图工具的使用
- 【leetcode每日一题】24.Swap Nodes in Pairs
- 本人是一名专科学生,现自学java,记录学习。希望能够大家多多提提意见