O GoConqr está de visual novo! Conte para nós o que você achou.

Mapa mental

Polymorphism

Nik Nguyen AP Computer Science Advanced Placement Inglês

Mind map about polymorphism: method changes in derived classes, base class methods and code example

Mind map: Polymorphism

Conteúdo do mapa

Polymorphism

  1. is meant to make changes in the method definition of the derived classes, and have those changes apply to methods written in the base class

  2. Example:

    • people[0] = new Undergraduate("Cotty, Manny", 4910, 1); people[1] = new Undergraduate("Kick, Anita", 9931, 2); people[2] = new Student("DeBanque, Robin", 8812); people[3] = new Undergraduate("Bugg, June", 9901, 4);    
    • people[0] = new Undergraduate("Cotty, Manny", 4910, 1); people[1] = new Undergraduate("Kick, Anita", 9931, 2); people[2] = new Student("DeBanque, Robin", 8812); people[3] = new Undergraduate("Bugg, June", 9901, 4);
      • Say we ran the writeOutput() method on each of these. Which writeOutput is used?
        • The one in the class that was USED TO CREATE THE OBJECT.
          • Not necessarily "person", but "Undergraduate" and "Student."
            • THIS IS A FORM OF DYNAMIC BINDING!
    • THERES A WHOLE PROJECT BASED ON EXAMPLES FOR POLYMORPHISM!

Informações

Descrição
Small mindmap on polymorphism.
Criado por
Nik Nguyen
Visualizações
121
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?