auto commit

This commit is contained in:
CyC2018 2018-09-18 09:42:24 +08:00
parent 57a741092b
commit f89ef4cf59

View File

@ -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);