Exemple #1
0
        static void Main(string[] args)
        {
            int tamaño = 5;
            Veterinaria veterinaria = new Veterinaria();
            Animal[] pAnimales = new Animal[tamaño];
            pAnimales[0] = new Gato();
            pAnimales[1] = new Perro();
            pAnimales[2] = new Cerdo();
            pAnimales[3] = new Caballo();
            pAnimales[4] = new Gallo();

            veterinaria.AceptarAnimales(pAnimales);
            Console.ReadKey();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Animal[] iAnimales = new Animal[2];
            Veterinaria iVeterinaria = new Veterinaria();

            Gato iGato = new Gato();
            Perro iPerro = new Perro();

            iAnimales[0] = iGato;
            iAnimales[1] = iPerro;

            iVeterinaria.AceptarAnimales(iAnimales);
            Console.ReadKey();
        }