Java_设计模式
文章平均质量分 70
MaximusKiang
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
单例模式的七种写法
转载请注明出处:http://cantellow.iteye.com/blog/838473 第一种(懒汉,线程不安全): Java代码 public class Singleton { private static Singleton instance; private Singleton (){} public stati转载 2014-03-18 22:56:15 · 609 阅读 · 0 评论 -
单例模式中,饿汉式和懒汉式有什么区别?各适合用在哪里?为什么说推荐用饿汉模式?
饿汉式: public class Singleton{ private static Singleton singleton = new Singleton (); private Singleton (){} public Singleton getInstance(){return singlet转载 2014-03-18 23:12:58 · 1026 阅读 · 0 评论 -
Singleton模式
一般Singleton模式通常有三种形式:第一种形式: 也是常用的形式。public class Singleton { private static Singleton instance = null; private Singleton(){ //do something } public static Singleton ge转载 2014-03-18 23:17:13 · 793 阅读 · 0 评论 -
Java开发中的23种设计模式详解(转)
From:http://www.cnblogs.com/maowang1991/archive/2013/04/15/3023236.html转载 2014-08-04 21:21:34 · 678 阅读 · 0 评论
分享