dreaming架构师,充分践行,适当补充理论的一年
shuofenglxy · 共 121 篇文章
菜鸟硕枫设计模式系列之1 单例模式
单例模式:顾名思义,一个类只存在一个这样的实例。并通过这个唯一实例来向系统提供实例行为。单例模式是一种创建型模式。应用场合当然是系统需要唯一该类实例的场合了,比如说资源管理器等。 单例模式类图: 具体实现代码: package singletonPattern; public class SingletonInstance { private static SingletonInstance singletonInstance = new SingletonInstance(); private SingletonInstance(){}; public static SingletonIn…
2010-12-09 13:32 · 菜鸟硕枫入门设计模式 · 评论(0) · 设计模式