public static AudiCar getCar() { AudiCar eCar = new AudiCar(); eCar.setGearBox(new EGearBox()); eCar.setStereo(new EStereo()); eCar.setWheels(new EWheel()); return(eCar); }
public static AudiCar getCar() { AudiCar mCar = new AudiCar(); mCar.setGearBox(new MGearBox()); mCar.setStereo(new MStereo()); mCar.setWheels(new MWheel()); return(mCar); }
public AudiCar getCar() { AudiCar audiCar = new AudiCar(); audiCar.setGearBox(getGearBox()); audiCar.setStereo(getStereo()); audiCar.setWheels(getWheel()); return(audiCar); }
public static AudiCar getCar() { AudiCar lCar = new AudiCar(); lCar.setGearBox(new LGearBox()); lCar.setStereo(new LStereo()); lCar.setWheels(new LWheel()); return(lCar); }
static void Main(string[] args) { AudiCar eCar = new AudiCar(); eCar.setGearBox(new EGearBox()); eCar.setStereo(new EStereo()); eCar.setWheels(new EWheel()); System.Console.WriteLine(eCar); AudiCar xCar = new AudiCar(); xCar.setGearBox(new EGearBox()); xCar.setStereo(new MStereo()); xCar.setWheels(new LWheel()); System.Console.WriteLine(xCar); }
static void Main(string[] args) { ICarFactory factory = new EconomyCarFactory(); AudiCar car1 = new AudiCar(); car1.setGearBox(factory.getGearBox()); car1.setStereo(factory.getStereo()); car1.setWheels(factory.getWheel()); System.Console.WriteLine(car1); factory = new MediumCarFactory(); AudiCar car2 = new AudiCar(); car2.setGearBox(factory.getGearBox()); car2.setStereo(factory.getStereo()); car2.setWheels(factory.getWheel()); System.Console.WriteLine(car2); }