我是新来的Java(与C#的经验),如何从(静态)类中的类创建新的类实例?
这就是我想做的事:
public final class MyClass
{
public class MyRelatedClass
{
...
}
}
public class OtherRandomClass
{
public void DoStuff()
{
MyRelatedClass data = new MyClass.MyRelatedClass();
}
}
这使得这个错误在Eclipse:
No enclosing instance of type BitmapEffects is accessible. Must qualify the allocation with an enclosing instance of type BitmapEffects (e.g. x.new A() where x is an instance of BitmapEffects).
这是可能在C#中使用静态类,这里应该怎么做?
可能重复[Java - 没有可以访问Foo类型的封闭实例](http://stackoverflow.com/questions/9560600/java-no-enclosing-instance-of-type- foo-is-accessible) – fabian 2016-03-03 23:46:05