html5-img
1 / 9

INSTITUTO TECNOLOGICO SUPERIOR DE LIBRES INGENIERIA EN SISTEMAS COMPUTACIONALES

INSTITUTO TECNOLOGICO SUPERIOR DE LIBRES INGENIERIA EN SISTEMAS COMPUTACIONALES PROGRAMACION ORIENTADA A OBJETOS (POO) POLIMORFISMO RUTH LÒPEZ MUÑOZ. CONCEPTO.

dagan
Download Presentation

INSTITUTO TECNOLOGICO SUPERIOR DE LIBRES INGENIERIA EN SISTEMAS COMPUTACIONALES

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. INSTITUTO TECNOLOGICO SUPERIOR DE LIBRES INGENIERIA EN SISTEMAS COMPUTACIONALES PROGRAMACION ORIENTADA A OBJETOS (POO) POLIMORFISMO RUTH LÒPEZ MUÑOZ

  2. CONCEPTO • En programación orientada a objetos el polimorfismo se refiere a la capacidad para que varias clases derivadas de una antecesora utilicen un mismo método de forma diferente.

  3. clasificación • Polimorfismo dinámico • Polimorfismo estático

  4. Polimorfismo dinamico • Es aquél en el que el código no incluye ningún tipo de especificación sobre el tipo de datos sobre el que se trabaja. Así, puede ser utilizado a todo tipo de datos compatible.

  5. Polimorfismo estático • Es aquél en el que los tipos a los que se aplica el polimorfismo deben ser explicitados y declarados uno por uno antes de poder ser utilizados.

  6. Ejemplo de polimorfismo • Podemos crear dos clases distintas: Pez y Ave que heredan de la superclaseAnimal. La claseAnimal tiene el método abstracto mover que se implementa de forma distinta en cada una de las subclases (peces y aves se mueven de forma distinta).

  7. Como ya mencionó anteriormente, el concepto de polimorfismo se puede aplicar tanto a funciones como a tipos de datos. Así nacen los conceptos de funciones polimórficas y tipos polimórficos.

  8. funcionespolimórficas • Son aquellas funciones que pueden evaluarse o ser aplicadas a diferentes tipos de datos de forma indistinta.

  9. tipospolimórficos • Son aquellos tipos de datos que contienen al menos un elemento cuyo tipo no está especificado.

More Related