Thread actressThread = new Thread(new Actress(),"Ms. Runnable");

来源:2-3 Java线程-隋唐演义实战开发---演员简介

鹰空捍卫者

2015-10-12 22:01

Thread actressThread = new Thread(new Actress(),"Ms. Runnable");

能解释一下这一行代码吗?详细点,谢谢

写回答 关注

4回答

  • 慕移动9181930
    2022-03-24 08:02:18
  • qq_时光机_11
    2017-03-27 00:00:00

    为什么 我的就报错

     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).

  • 慕斯卡4106679
    2015-11-09 22:32:05

    调用了这个方法,可以查查JDKpublic Thread(Runnable target, String name)

    慕斯卡410...

    写错字,是API

    2015-11-10 20:52:19

    共 1 条回复 >

  • 星际怪物
    2015-10-14 10:11:30

    没看视频,new Actress() 应该是实现runnable接口类吧,"Ms. Runnable"给该线程一个Threadname



深入浅出Java多线程

带你一起深入浅出多线程,掌握基础,展望进阶路线

186088 学习 · 464 问题

查看课程

相似问题