![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
设计模式
编程设计思想
全干小二
这个作者很懒,什么都没留下…
展开
-
java设计模式-修饰器模式
模拟修饰器设计模式原创 2022-06-05 20:11:26 · 244 阅读 · 0 评论 -
设计模式 --单例模式
package singleton_pattern; /* * 设计模式 * --单例模式 */ public class SingleTonPattern { public static void main(String[] args) { SingleTon s1=SingleTon.getInstance(); // SingleTon s2=SingleTon.getInstance(); System.out.println(s1); SingleTon2 s3=Sing原创 2021-11-21 18:14:30 · 184 阅读 · 0 评论 -
设计模式 --工厂模式
package factory_pattern; /* * 设计模式 * --工厂模式(多用来提供API) */ public class FactoryPattern { public static void main(String[] args) { IFactory f=new Factory(); Model product=f.getProduct("可乐"); product.createProduct(); Model product1=f.getProduct("原创 2021-11-21 18:48:17 · 187 阅读 · 0 评论