课程
/后端开发
/Java
/深入浅出Java多线程
Thread actressThread = new Thread(new Actress(),"Ms. Runnable");
能解释一下这一行代码吗?详细点,谢谢
2015-10-12
源自:深入浅出Java多线程 2-3
正在回答
去意见反馈。会有人解决的为什么?配置系统变量,就是所有用户都可以用,配置用户变量就是只用当前用户可以用?
为什么 我的就报错
No enclosing instance of type Actor is accessible. Must qualify the allocation with an enclosing instance of type Actor (e.g. x.new A() where x is an instance of Actor).
调用了这个方法,可以查查JDKpublic Thread(Runnable target, String name)
慕斯卡4106679
没看视频,new Actress() 应该是实现runnable接口类吧,"Ms. Runnable"给该线程一个Threadname
举报
带你一起深入浅出多线程,掌握基础,展望进阶路线
1 回答Thread actressthread=new Thread(new Actress(),"Ms.Runnable");报错啊
2 回答Thread actressThread=new Thread(new Actress(),"MsRunnable")为什么创建Actress()实例用要用Thread的方法
2 回答new Thread
3 回答Thread actor=new Thread(new Actor(),"Mr.Thread");
4 回答thread类里new一个Actress为什么会报错