多线程安全 Singleton
<span style="font-size:24px;">/**
*
* @author chunxiao
* @version 1.0
*/
public class Singleton {
private Singleton() {
}
public static Singleton getInstance() {
return SingletonHolder.INSTANCE;
}
private static class SingletonHolder {
private static final Singleton INSTANCE = new Singleton();
}
}</span>
lazy loading版本的线程安全单例模式
作者 rjgcx2
补充:综合编程 , 安全编程 ,