如果我像这样创建一个基础对象:
public abstract class RIBaseObject{
static ObjectRegistry sSystemRegistry = new ObjectRegistry();
public RIBaseObject() {
}
public abstract void reset();
}
并在我制作的每个(大多数)类中扩展这个基础对象,考虑到 ObjectRegistry 包含如下参数:
public class ObjectRegistry extends RIBaseObject {
public BufferLibrary bufferLibrary;
public CameraSystem cameraSystem;
public ObjectRegistry() {
super();
}
}
将在引导类中以这种方式声明 bufferLibrary:
RIBaseObject.sSystemRegistry.bufferLibrary = new BufferLibrary();
让它从任何扩展 BaseObject 的类中访问同一个 bufferLibrary 对象?还是会有所不同?