Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Animal myAnimal = new Animal(); // Create a Animal object
            Animal myPig    = new Pig();    // Create a Pig object
            Animal myDog    = new Dog();    // Create a Dog object

            myAnimal.animalSound();
            myPig.animalSound();
            myDog.animalSound();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Animal myAnimal = new Animal();
            Animal myPig    = new Pig();
            Animal myDog    = new Dog();

            myAnimal.animalSound();
            myPig.animalSound();
            myDog.animalSound();
        }