第二十一章 单例模式
/** * Created by hero on 16-4-6. */ public class Singleton { public static Singleton getInstance() { return SingletonHolder.singleton; } private static class SingletonHolder { private static Singleton singleton = new Singleton(); } private Singleton() { } }
世上无难事,只要肯登攀。