标签:span turn style static ati zed 单例 font 懒汉
/**
* 单例模式:懒汉式
*/
class Singleton{
private static volatile Singleton singleton = null;
private Singleton(){
}
public static Singleton getInstance(){
if(singleton == null){
synchronized (Singleton.class){
if (singleton == null){
singleton = new Singleton();
}
}
}
return singleton;
}
标签:span turn style static ati zed 单例 font 懒汉
原文地址:https://www.cnblogs.com/cn-chy-com/p/10855903.html