コード例 #1
0
        private static void Main(string[] args)
        {
            Car car1 = new Car();
            IFactory factory = new SolarFactory();
            car1.Engine = factory.GetEngine();
            car1.Dynamo = factory.GetDynamo();

            car1.Drive();

            Console.ReadLine();
        }
コード例 #2
0
        private static void Main(string[] args)
        {
            Car      car1    = new Car();
            IFactory factory = new SolarFactory();

            car1.Engine = factory.GetEngine();
            car1.Dynamo = factory.GetDynamo();

            car1.Drive();

            Console.ReadLine();
        }