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

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

旗开得胜wds

2016-10-13 11:14

我在main()函数写调用Actress的代码,Thread actressThread = new Thread(new Actress(),"Ms.Runnable");总是出问题,问题是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).

求教各位!

写回答 关注

2回答

  • leo_messi
    2016-10-19 16:39:21

    把Actress类写在Actor类外面就可以了

    慕无忌328...

    我试了写到里面,然后把Actress()改为Actor.Actress()还是那句出现错误,这到底是怎么回事?求教大神

    2017-05-24 17:07:10

    共 2 条回复 >

  • K_Muxs
    2016-10-13 23:53:46

    建议你把你写的代码复制出来,在这个输入框有一个代码语言可以选

深入浅出Java多线程

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

186088 学习 · 464 问题

查看课程

相似问题