设计模式
搬砖老头
仰望星空,脚踏实地!天道酬勤,机会总是留给有准备的人!
展开
-
python 装饰器
https://www.zhihu.com/question/26930016知乎解析了装饰器的作用。 def 炼丹炉(func): def 变身(*args, **kwargs): print('有火眼金睛了') return func(*args, **kwargs) return 变身 def 龙宫走一趟(func): def 你好(*args, **kwargs): print('有金箍棒了') return func(*ar..转载 2021-06-21 16:21:37 · 81 阅读 · 0 评论 -
java设计模式
所谓“懒汉式”与“饿汉式”的区别,是在与建立单例对象的时间不同。 “懒汉式”是在你真正用到的时候才去建这个单例对象: 比如: public class Singleton{ private static Singleton singleton = null; public static synchronized get原创 2017-08-04 09:37:41 · 169 阅读 · 0 评论