singleton
singleton 英 ['sɪŋg(ə)lt(ə)n] 美 ['sɪŋɡltən]
n. 一个;独身
名词复数:singletons
- 请先登录
- n. 一个;独身
-
1. Since there is only one singleton instance, any instance fields of a singleton will occur only once per class, just like static fields.
由于只有一个单实例,单例对象的域只会在一个类中出现一次,就像静态域一样。
-
2. For example, an expression could not refer to an instance field that will be computed inside the class or object body, but it could invoke a method on a singleton object.
比如说,一个表达式不能引用类或者对象主体内才被计算的实例字段,但是它可以引用一个方法或者一个单例对象。
-
3. Static access is especially useful for implementing the singleton design pattern, where only one instance of class exists.
静态访问特别适合实现单一设计模式,在这种模式中只存在一个类实例。
- 请先登录
0 个回复