16 lines
331 B
Java
16 lines
331 B
Java
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;
|
|
}
|
|
}
|