1. 单例模式 (1)概念 单例模式的定义是:确保一个类只有一个实例,而且自行实例化并向整个系统提供这个实例。 (2)类图、代码 单例模式的类图设计如下: 单例模式中的主动实例化(加载类时实例化单例类)[推荐使用]: 外部通过代码Singleton singleton = Singleton.get Read More
posted @ 2017-01-04 17:19 LangZXG Views(1367) Comments(0) Diggs(0) Edit