Jhonney的專欄

             ----人見人愛
          隨筆 - 49, 文章 - 1, 評論 - 23, 引用 - 0
          數(shù)據(jù)加載中……

          單例的實現(xiàn)

          public class Singleton {     
              
            static class SingletonHolder {     
              static Singleton instance = new Singleton();     
            }     
              
            public static Singleton getInstance() {     
              return SingletonHolder.instance;     
            }     
              
          }   

          See in : http://crazybob.org/2007/01/lazy-loading-singletons.html
          See also : http://www.oreillynet.com/onjava/blog/2007/01/singletons_and_lazy_loading.html

          posted on 2007-04-12 21:55 Jhonney 閱讀(282) 評論(0)  編輯  收藏 所屬分類: 轉(zhuǎn)載區(qū)

          主站蜘蛛池模板: 博罗县| 桂东县| 临城县| 云梦县| 中方县| 长子县| 名山县| 无极县| 云浮市| 保山市| 越西县| 当雄县| 盐城市| 商城县| 南靖县| 大冶市| 武平县| 永康市| 彭州市| 焦作市| 丽水市| 民丰县| 前郭尔| 高清| 郁南县| 青阳县| 宜君县| 信阳市| 平泉县| 泸溪县| 遵化市| 武穴市| 马公市| 团风县| 竹北市| 赤城县| 云霄县| 江油市| 吉木萨尔县| 大邑县| 日土县|