为什么我的new Thread(new Actress(), "Ms.Runnable");这句上的new Actress()爆出这个下面这个错误
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).
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).
2016-12-20
Actress类应该被定义在Actor类的里边了, 也就是说Actress被弄成Actor的内部类了,把Actress类的代码复制到Actor外边
public class Actor(){
}
class Actress(){
}
或者new Actress()改为new Actor.Actress()就可以了.
举报