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

            animalObj.MakeSound();

            Dog dogObj = new Dog();

            dogObj.MakeSound();
            dogObj.DoTricks();

            Animal dog = new Dog();

            dog.MakeSound();
            //Dog wholeDog = (Cat)dog;
            //wholeDog.PatTheCat();

            Cat catObj = new Cat();

            catObj.MakeSound();

            Animal cat = new Cat();

            cat.MakeSound();

            Console.ReadKey();
        }