摘要: 单例模式需要备忘的部分为:如何创建线程安全的懒汉式单例类 首先java不能使用DCL写法,如下: 1 /** 2 * 实现单例访问Kerrigan的第四次尝试 3 */ 4 public class SingletonKerriganD { 5 6 /** 7 * 单例对象实例 8 */ 9 private static SingletonKerriganD instance = null; 10 11 public ... 阅读全文
posted @ 2013-08-16 15:17 Mr.Ding 阅读(140) 评论(0) 推荐(0) 编辑