added lab3 ex2

This commit is contained in:
2024-10-07 11:14:07 +02:00
parent 5fbcd72ea6
commit 7c3d0b2cbd
10 changed files with 132 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
package lab3_abstract_factory.ex2;
public class CarCreator {
private CarFactory carFactory;
public CarCreator(CarFactory carFactory) {
this.carFactory = carFactory;
}
public Car orderCar(String color) {
Car car = carFactory.createCar();
car.paintColor(color);
return car;
}
}