auto commit
This commit is contained in:
parent
57a741092b
commit
f89ef4cf59
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user