Exemplo n.º 1
0
        private static void Main(string[] args)
        {
            var duck = new Duck();

            DoRun(duck);
            DoSwim(duck);
            DoFly(duck);

            var runnerDuck = new RunnerDuck();

            DoRun(runnerDuck);
            DoSwim(runnerDuck);
            //DoFly(runnerDuck); <-- not possible: Build will fail!

            Console.ReadLine();
        }
Exemplo n.º 2
0
        private static void Main(string[] args)
        {
            var duck = new Duck();

            DoRun(duck);
            DoSwim(duck);
            DoFly(duck);

            var runnerDuck = new RunnerDuck();

            DoRun(runnerDuck);
            DoSwim(runnerDuck);
            //DoFly(runnerDuck);

            Console.ReadLine();
        }