标签:get sync code pre private zed vol on() return
public class Singleton {//单例模式 double-check}
public Singleton getSingleton(){
if(singleton==null){
synchronized (Singleton.class) {
singleton=new Singleton();
}
}
return singleton;
}
}
标签:get sync code pre private zed vol on() return
原文地址:http://blog.51cto.com/13919712/2158315