コード例 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("IPhone interface:");
            Phone small = new Phone(new Small());
            Phone big   = new Phone(new Big());

            small.Start();
            big.Start();
            Console.WriteLine();
            Console.WriteLine("Demonstration of IComp interface:");
            Kon ch = new Kon(new Cheap());
            Kon ex = new Kon(new Exp());

            ch.Start();
            ex.Start();
            Console.ReadKey();
        }