Example #1
0
        public void CheckExoticDuck()
        {
            var wd = new ExoticDuck();

            wd.Show();
            wd.Fly();
            wd.Quack();
            wd.Swim();
        }
Example #2
0
        static void Main(string[] args)
        {
            BaseDuck duck = new OrdinaryDuck();

            duck.Display();
            duck = new WoodDuck();
            duck.Display();
            duck = new ExoticDuck();
            duck.Display();
            duck.setFlyBehavior(new DoNotFly());
            duck.Display();
            Console.Read();
        }