设计模式开始--单例模式

单例模式

一、作用:

保证一个类只有一个实例,并提供一个访问它的全局访问点

二、单线程实现

三、多线程实现

原文地址:https://www.cnblogs.com/sunshisonghit/p/4384249.html