static void Main(string[] args) { Duck mallard = new MallardDuck(); mallard.performFly(); mallard.performQuack(); Duck model = new ModelDuck(); model.performFly(); model.setFlyBehavior(new FlyRocketPowered()); model.performFly(); }
static void Main(string[] args) { Duck mallard = new MallardDuck(); mallard.display(); mallard.performQuack(); mallard.performFly(); Console.WriteLine("\n"); Duck model = new ModelDuck(); model.display(); model.performFly(); model.setFlyBehavior(new FlyRocketPowered()); model.performFly(); }