以上来源于: WordNet
The DefaultDAO class stores an instance of itself (as a Singleton) in the static variable instance, allowing access to that instance through the getInstance() method.
DefaultDAO 类在静态变量 instance 中存储了它自己的一个实例(存储为 Singleton),并允许通过 getInstance() 方法访问该实例。
This line of code creates a Singleton object and initializes the variable instance to refer to this object.
此行代码创建了一个Singleton对象并初始化变量instance来引用此对象。
The problem with this line of code is that the variable instance can become non-null before the body of the Singleton constructor executes.
这行代码的问题是:在Singleton构造函数体执行之前,变量instance可能成为非null的。
应用推荐