From f89ef4cf591d2ef04f89e3428fc2af34be56617d Mon Sep 17 00:00:00 2001 From: CyC2018 <1029579233@qq.com> Date: Tue, 18 Sep 2018 09:42:24 +0800 Subject: [PATCH] auto commit --- notes/设计模式.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/notes/设计模式.md b/notes/设计模式.md index 8c9f0b22..c177ff92 100644 --- a/notes/设计模式.md +++ b/notes/设计模式.md @@ -276,6 +276,7 @@ public class ConcreteProduct2 implements Product { ```java public class Client { + public static void main(String[] args) { int type = 1; Product product; @@ -295,6 +296,7 @@ public class Client { ```java public class SimpleFactory { + public Product createProduct(int type) { if (type == 1) { return new ConcreteProduct1(); @@ -308,6 +310,7 @@ public class SimpleFactory { ```java public class Client { + public static void main(String[] args) { SimpleFactory simpleFactory = new SimpleFactory(); Product product = simpleFactory.createProduct(1);