Example #1
0
        static void Main(string[] args)
        {
            Humano humano = new Humano();

            Console.WriteLine("soy humano:");
            humano.Respira();

            Gorila gorila = new Gorila();

            Console.WriteLine("soy Gorila:");
            gorila.SoyNegro();
            gorila.Comer();

            Caballo caballo = new Caballo();

            Console.WriteLine("soy un caballo :");
            caballo.CorroRapido();
            caballo.TienenHijos();

            niños niño = new niños();

            niño.lloro();
            niño.Pienso();

            Object obj = new object();

            Console.WriteLine(obj.GetType().ToString());
        }
Example #2
0
        static void Main(string[] args)
        {
            Caballo Bebieca = new Caballo("Bebieca");
            InterfaceMmiferosTerrestres caballo = new Caballo("Bebieca");
            InterfaceSalto caballo1             = new Caballo("Bebieca");
            Humano         Israel    = new Humano("Israel");
            Gorila         Goku      = new Gorila("Goku");
            Ballena        fliper    = new Ballena("Fliper");
            Lagartija      lagartito = new Lagartija("Lagartito");

            lagartito.respirar();
            lagartito.getNombre();
            Bebieca.getNombre();
            Israel.getNombre();
            Goku.getNombre();
            fliper.respirar();
            fliper.nadar();
            Console.WriteLine(Israel.deporte());
            Console.WriteLine("Tengo: " + caballo.numeroPatas() + " Patas");
            Console.WriteLine("Salgo con: " + caballo1.numeroPatas() + " patas");
            Bebieca.deporte();

            Mamiferos[] mamiferos = new Mamiferos[3];
            mamiferos[0] = Bebieca;
            mamiferos[1] = Israel;
            mamiferos[2] = Goku;

            mamiferos[1].getNombre();
            for (int i = 0; i < 3; i++)
            {
                mamiferos[i].pensar();
            }

            //Object miAnimal = new Caballo("Bucefalo");
            //Object miPersona = new Humano("Ernesto");
        }