Java出现No enclosing instance of type H is accessible. Must qualify the allocation with an enclosing
来源:互联网 发布:杭州网站建设宣盟网络 编辑:程序博客网 时间:2024/05/22 11:38
就是main函数中调用内部静态类,我把内部静态类改成非静态报的错。
类大概是
class A
{
public static void main(String[] args) {
B b= new B(); //这里报错
//应该写成: A.B b = new A().new B();
//原因是 静态函数加载的早,A,B都是非静态类,不明确A就不知道B。当然你把B写成静态类也能不报错,但B需要那么优先放入内存么?
}
class B
{
}
}
0 0
- Java出现No enclosing instance of type H is accessible. Must qualify the allocation with an enclosing
- Java出现No enclosing instance of type ImageViewer is accessible. Must qualify the allocation with an
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- JAVA中出现No enclosing instance of type * is accessible. Must qualify the allocation with an enclosing
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- Java学习—I/O
- java实现图种应用,将电影或种子隐藏到图片中
- matlab心形图大全,几个经典的函数图像,有趣的函数图像,matlab画图
- 关于软键盘的坑
- (1)hibenrate入门例子
- Java出现No enclosing instance of type H is accessible. Must qualify the allocation with an enclosing
- 猜数字游戏
- 137. PHP static::
- 应用商店第一课--软件的架构
- Eclipse常用开发插件
- [机器学习] Coursera笔记 - 机器学习应用的建议-Part3
- 蓝桥杯单片机几种电子器件和锁存
- Win7下Genymotion中下载的Android虚拟器无法启动的问题总结
- Jsp动态网站初步项目 --简单的商品浏览页面 (登录功能二)