public static void Test()
 {
     ICarFactory carFactory = new CarFactory();
     var car = carFactory.MakeCar();
     carFactory = new SportCarFactory();
     car = carFactory.MakeCar();
 }
コード例 #2
0
        public static void Test()
        {
            ICarFactory carFactory = new CarFactory();
            var         car        = carFactory.MakeCar();

            carFactory = new SportCarFactory();
            car        = carFactory.MakeCar();
        }