Exemple #1
0
        static void Main(string[] args)
        {
            GermanShepherd Bubble = new GermanShepherd();

            Console.WriteLine(Bubble.GoForAWalk());
            Bubble.Name = "Bubble";
            Bubble.Bark();



            //Console.ReadLine();

            List <IDog> dogs = new List <IDog>();

            dogs.Add(Bubble);
            dogs.Add(new Chihuahua("Butch"));

            Console.WriteLine();

            foreach (var dog in dogs)
            {
                Console.WriteLine($"{dog.Name} {dog.GoForAWalk()}");
                dog.Bark();
            }

            Console.ReadLine();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            GermanShepherd bigDog    = new GermanShepherd();
            Yorkie         littleDog = new Yorkie();

            GiveTreat(bigDog);
            GiveTreat(littleDog);

            Console.ReadLine();
        }