姜敞 7-3 11:28:42 public class Singleton { private static volatile Singleton sSingleton; private Singleton(){ } public Singleton getInstance(){ if(sSingleton == null){ synchronized (Singleton.class) { if(sSingleton == null){ sSingleton = new Singleton(); } } } return sSingleton; } } private static volatile Singleton sSingleton 就是这个成员变量用的时候才初始化