public void CheckExoticDuck() { var wd = new ExoticDuck(); wd.Show(); wd.Fly(); wd.Quack(); wd.Swim(); }
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(); }