![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
设计模式
KeepGoingPawn
KeepGoingPawn
展开
-
【设计模式】-NO1.单例模式
单例模式 大家好! 写这篇博客的目的是分析一下单例模式的使用,做到知其然知其所以然。 The real target is that I was asked the 单例模式 usage in the interview. And I cann’t answer it. 真正目的是因为在面试中被问到单例模式在充血模型和贫血模型这块有什么区别。 ...原创 2019-03-13 13:59:18 · 262 阅读 · 0 评论 -
Java:单例模式的七种写法
第一种(懒汉,线程不安全): 1publicclassSingleton{2privatestaticSingletoninstance;3privateSingleton(){}4publicstaticSingletongetInstance(){5if(instance==null){...转载 2017-03-01 10:59:58 · 204 阅读 · 0 评论