mirror of https://github.com/01-edu/public.git
docs: change the main file to be aling with the subject
This commit is contained in:
parent
a9a53977e9
commit
6f4f10e010
|
@ -2,7 +2,20 @@ public class ExerciseRunner {
|
|||
public static void main(String[] args) {
|
||||
Factory factory = new Factory();
|
||||
|
||||
// Handle invalid product type
|
||||
ConcreteProductA productA = factory.createProduct("A");
|
||||
if (productA != null) {
|
||||
productA.showDetails();
|
||||
} else {
|
||||
System.out.println("Invalid product type");
|
||||
}
|
||||
|
||||
ConcreteProductA productB = factory.createProduct("B");
|
||||
if (productB != null) {
|
||||
productB.showDetails();
|
||||
} else {
|
||||
System.out.println("Invalid product type");
|
||||
}
|
||||
|
||||
Object invalidProduct = factory.createProduct("C");
|
||||
if (invalidProduct != null) {
|
||||
invalidProduct.showDetails();
|
||||
|
|
Loading…
Reference in New Issue