示例#1
0
        public static void Run()
        {
            Cow cow = new Cow(80);
            Bear bear = new Bear(80);
            Duck duck = new Duck(100);

            Console.WriteLine(cow.TryToFly());
            Console.WriteLine(bear.TryToFly());
            Console.WriteLine(duck.TryToFly());
            
        }
示例#2
0
        public static void Run()
        {
            Animal cow = new Cow(80);
            Animal bear = new Bear(80);
            Animal duck = new Duck(100);

            Console.WriteLine(cow.Sound);
            Console.WriteLine(cow.TryToFly());

            Console.WriteLine(bear.Sound);
            Console.WriteLine(bear.TryToFly());

            Console.WriteLine(duck.Sound);
            Console.WriteLine(duck.TryToFly());

        }