Nu am putut găsi această intrare. Se afișează rezultate aproximative. Verificați ortografia sau propuneți adăugarea acestui termen în dicționar.
单件模式
In the process of writing the code, We will meet when the need to ensure that only one instance of the global, This time use the singleton pattern.
在写代码的过程当中,我们总会遇到需要保证全局只有一个实例的时候,这个时候就要使用单件模式。
The Singleton pattern is used in the design of logger classes.
单件模式被用在日志记录类中。
What about how to implement the singleton pattern? We take a look at the classic Java code, How to implement the singleton pattern.
那么怎么实现单件模式呢?我们来看看最经典的 Java 代码,该怎么实现这个 单件模式。
Since it is thread safe by design, you might cache it in a public static final variable, or wrap it in a singleton pattern after creation for later access.
It is typically used to reduce locking overhead when implementing "lazy initialization" in a multi-threaded environment, especially as part of the Singleton pattern.
它通常用于减少加锁开销,尤其是为多线程环境中的单例模式 实现"惰性初始化 "。
Conținut posibil inadecvat
Exemplele au rolul de a te ajuta să traduci cuvinte sau expresii corect si adaptat la context. Nu sunt selectate sau validate manual, așadar pot conține termeni inadecvați. Te rugăm să raportezi exemplele pe care le consideri inadecvate. Traducerile vulgare sau colocviale sunt în general marcate cu roșu sau cu portocaliu.