シングルトンにInitialize-On-Demand Holder
メモしておく:
http://d.hatena.ne.jp/fumokmm/20080410/1207837279
class Singleton { /** インスタンスホルダー */ private static class Holder { public static final Singleton instance = new Singleton(); }; ... /** コンストラクタは封印 */ private Singleton(){}; /** 唯一のSingletonインスタンスをゲット! */ public static Singleton getInstance() { return Holder.instance; } }

anonymous
Powered by
Reactions