2

JAVA线程安全的单例-移望yuan的博客

 3 years ago
source link: https://blog.51cto.com/12824426/2560964
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
一、单例的含义单例模式是为确保一个类只有一个实例,并为整个系统提供一个全局访问点的一种模式方法。从概念中体现出了单例的一些特点:(1)、在任何情况下,单例类永远只有一个实例存在(2)、单例需要有能力为整个系统提供这一唯一实例在计算机系统中,**线程池、缓存、日志对象、对话框、打印机、显卡的驱动程序对象**常被设计成单例。这些应用都或多或少具有资源管理器的功能。每台计算机可以有若干个打印机,但只能有

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK