Exemplo n.º 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());
            
        }
Exemplo n.º 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());

        }