コード例 #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();
        }
コード例 #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();
        }