No enclosing instance of type ThreadTest is accessible.错误解决
来源:互联网 发布:淘宝买二手吉他靠谱吗 编辑:程序博客网 时间:2024/06/05 11:20
闲着学习了一下线程的知识,于是创建了一个类,跟着教材上敲了一下代码,结果在MyEclipse中出现了
No enclosing instance of type TestThread is accessible. Must qualify the allocation with an enclosing instance of type TestThread (e.g. x.new A() where x is an instance of TestThread).这样的错误提示,看看语义,翻译过来以后大概意思是:没有可访问的内部类TestThread的实例。百度了一下此项内容,大部分都是说类的动态和静态调用的问题,仔细看看原来是讲另一个类写在了main方法里面了,将其方法移出main方法之外出现以下情况The public type Runner1 must be defined in its own file,至此问题很显然,原来需要另外new一个Runner1,将TestThread里面的Runner1删除就可以了,内中原理也一应明了,轻松解决。
0 0
- No enclosing instance of type ThreadTest is accessible.错误解决
- Java错误:No enclosing instance of type MyClass is accessible.
- 解决No enclosing instance of type * is accessible
- No enclosing instance of type * is accessible.
- No enclosing instance of type is accessible.
- 【JAVA001】No enclosing instance of type XXX is accessible.
- No enclosing instance of type E is accessible
- No enclosing instance of type E is accessible
- 黑马程序员--No enclosing instance of type E is accessible.
- No enclosing instance of type xxx is accessible
- No enclosing instance of type E is accessible
- No enclosing instance of type Demo06 is accessible.
- No enclosing instance of type XXX is accessible
- No enclosing instance of the type RegisterActivity is accessible
- 报错:No enclosing instance of type ExtendsDemo is accessible.
- No enclosing instance of type test is accessible.
- Java出现No enclosing instance of type E is accessible
- No enclosing instance of type Interface is accessible.
- 美国简史
- ios技术博客精选
- Yii CGridView 基本使用(一)初展身手
- Android SDK Android NDK Android Studio 官方下载地址
- 排序算法之归并排序
- No enclosing instance of type ThreadTest is accessible.错误解决
- 线性表----队列(链接表示)的基本操作
- 【深度探索STL】特殊容器 string
- 【数据库视频】耿建玲VS自考
- poj-3368 Frequent values 线段树
- uva 12260 Free Goodies DP+一点点贪心
- 为PHP摇旗呐喊!
- oc类命名规范
- Android Intent使用