Java的一个错误提示
来源:互联网 发布:javascript base64解码 编辑:程序博客网 时间:2024/05/13 03:41
最近在写代码时,遇到一个错误提示,老是不知道为什么,于是google了一下,将结果写下来,供大家学习和交流。
错误提示:
No enclosing instance of type Foo is accessible. Must qualify the allocation with an enclosing instance of type Foo (e.g. x.new A() where x is an instance of Foo).
原因是:
if you try to instantiate an inner class without an instance of the outer class.
在没有外部类对象时试图初始化一个内部类。
所以你应该先new一个外部类,然后通过它来new内部类
参见:
http://java.sun.com/docs/books/tutorial/java/javaOO/innerclasses.html
http://java.syntaxerrors.info/index.php?title=No_enclosing_instance_of_type_Foo_is_accessible._Must_qualify_the_allocation_with_an_enclosing_instance_of_type_Foo_(e.g._x.new_A()_where_x_is_an_instance_of_Foo).
- Java的一个错误提示
- 关于Qt的一个错误提示
- vs 的一个错误提示代码
- Rose2003提示java错误的解决过程
- Java错误提示------println()错误
- Java错误提示
- Java错误提示----------
- 一个常见的Java错误
- 一个java的调试错误
- IE9中一个很恶心的JS错误提示
- 通过一个详细的例子解读错误提示
- 使用Qt create编程时提示的一个链接错误
- 如何制作一个完美的错误提示信息
- 弹出一个错误提示对话框
- jsf的错误提示
- Log4j的错误提示
- Access数据库中提示错误“至少一个参数没有被指定值”错误的可能原因
- java MappingException提示Association references unmapped class错误的解决方法
- 使用SqlDataSource插入、更新以及删除数据
- PL/SQL版的MD5加密函数
- Latent Semantic Analysis(LSA)
- 从oracle表中随机取记录,产生随机数和随机字符串
- C#以不规则方式显示图像
- Java的一个错误提示
- spring hibernate 事务管理
- 读《杜拉拉升职记》的感受、还有摘录
- ABAP指针(转)
- VS2005编译ACE
- 最近sql数据库的使用总结
- SAP 中如何使用指针或替代变量?
- 除了google广告以后的国外的广告联盟
- SY-SUBRC 的含义