示例#1
0
        private static void Main(string[] args)
        {
            string carName = "BMW";
            var    car     = AutoFactory.CreateCar(carName);

            car.Start();
            car.Stop();
            Console.ReadKey();
        }
示例#2
0
        static void Main(string[] args)
        {
            //string carName = args[0];
            string carName    = Console.ReadLine();
            var    carFactory = new AutoFactory();

            var car = carFactory.CreateInstance(carName);

            car.TurnOn();
            car.TurnOff();

            Console.ReadLine();
        }