问答详情
源自:2-3 Java线程-隋唐演义实战开发---演员简介

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

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

求教各位!

提问者:旗开得胜wds 2016-10-13 11:14

个回答

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

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

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

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