コード例 #1
0
        public static void Main()
        {
            Bird animal = new Bird();

            animal.ShowType();
            Chicken chicken = new Chicken();

            chicken.Eat();
            chicken.ShowColor();
            chicken.ShowType();

            Bird bird = new Chicken();

            bird.ShowType();
            Console.WriteLine(bird.type);

            ChickenAdapter ca = new ChickenAdapter();

            ca.ToTweet();

            BirdAdapter ba = new BirdAdapter(new Chicken());

            ba.ShowType();
            ba.ToTweet();

            Console.Read();
        }
コード例 #2
0
        public static void Main()
        {
            Bird animal = new Bird();
            animal.ShowType();
            Chicken chicken = new Chicken();
            chicken.Eat();
            chicken.ShowColor();
            chicken.ShowType();

            Bird bird = new Chicken();
            bird.ShowType();
            Console.WriteLine(bird.type);

            ChickenAdapter ca = new ChickenAdapter();
            ca.ToTweet();

            BirdAdapter ba = new BirdAdapter(new Chicken());
            ba.ShowType();
            ba.ToTweet();

            Console.Read();
        }