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

Mapa mental

Inheritance

Tanner Smelt Inglês

Conteúdo do mapa

Inheritance

  1. Makes code extensible in any OOP language

    • You can extend a class by creating a new class called the child or subclass
      • Gives the opportunity to add functionality that did not exist in the original class
      • A subclass can access its superclass's public and protected methods and fields
  2. Extends keyword

    • This is normally the default setting for Java
    • Extended classes develop an "is-a" relationship
  3. Overriding

    • Subclass can change the behavior of a method in the parent class
      • Occurs when the subclass method has the same signature as the parent class
    • Does not work for private methods
    • Cannot override a Final method
  4. Calling Superclass constructors

    • A no-argument constructor is created in a subclass if one is not explicitly created
      • This ensures the first thing called in the subclass is the no- arg constructor of the direct superclass, using the keyword "Super"
        • You must explicitly call a parent class's constructor if there is no "no-arg" class in either class
        • super keyword can also call a hidden member or overridden method from the superclass
  5. Type Casting

    • You can cast an object to another type
      • Can only cast from a subclass to its parent class
  6. Final Keyword

    • Prevents a class from being extended further
  7. Instanceof keyword

    • Can be used to test if an object is of a specified type

Informações

Descrição
Mapa Mental sobre Inheritance, criado por Tanner Smelt em 21-11-2019.
Criado por
Tanner Smelt
Visualizações
0
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?