No enclosing instance of type Monster is accessible. Must qualify the allocation with an enclosing i
来源:互联网 发布:淘宝一个宝贝多个价格 编辑:程序博客网 时间:2024/05/22 06:54
错误提示:No enclosing instance of type Monster is accessible. Must qualify the allocation with an enclosing instance of type Monster (e.g. x.new A() where x is an instance of Monster).
于是百度谷歌了一下相关资料。原来我写的内部类是动态的,也就是开头以public class开头。而主程序是public static class main。在Java中,类中的静态方法不能直接调用动态方法。只有将某个内部类修饰为静态类,然后才能够在静态类中调用该类的成员变量与成员方法。所以解决办法是将public class改为public static class.
- No enclosing instance of type Monster is accessible. Must qualify the allocation with an enclosing i
- - No enclosing instance of type Test is accessible. Must qualify the allocation with an enclosing in
- No enclosing instance of type ChuangKou 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
- No enclosing instance of type X 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 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
- No enclosing instance of type Outer is accessible. Must qualify the allocation with an enclosing ins
- 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 * 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
- Graduating from college
- cocos2d-html5学习笔记(六)--alpha2中cc.Sequence.create中的bug
- linux文件编程-苏嵌实训第11天
- GM7150 低功耗 NTSC/PAL 视频解码器 PIN TO PIN 完全替代TVP5150
- 一位老鸟对 23 种设计模式的有趣见解
- No enclosing instance of type Monster is accessible. Must qualify the allocation with an enclosing i
- maven插件安装
- Web Application 和 Web Service 的区别与联系
- 使用VisualSVN建立SVN服务器
- UIWebView与JavaScript的交互
- 《那些年啊,那些事——一个程序员的奋斗史》——115
- 虚函数无敌解释
- 关于 JAR 您不知道的 5 件事
- Android入门:多线程断点下载