You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
public class Factory {
|
|
public static Product createProduct(String type) {
|
|
if ("A".equalsIgnoreCase(type)) {
|
|
return new ConcreteProductA();
|
|
} else if ("B".equalsIgnoreCase(type)) {
|
|
return new ConcreteProductB();
|
|
}
|
|
return null;
|
|
}
|
|
} |