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

Mapa mental

Inheritance

Jeremy Deleon Inglês

Inheritance

Conteúdo do mapa

Inheritance

  1. Extend

    • Done automatically in Java as an Object is the superclass
      • Notation:
  2. The Is-a Relationship

  3. Superclass and subclasses

  4. Accessibility

    • P and C: P has three methods, public, protected and one with default class
      • The subclass C can access all these classes but a method outside of the subclass cannot access the default class
  5. Method Overriding

    • You can change the behavior of a method in a parent class by writing the new method in the subclass. This is possible to do for the public and protected methods. If subclass and superclass are in the same package, then you can also change default access level.
      • You can avoid overriding a method by writing final.
  6. Calling a superclass' no-arg constructor

  7. Calling a superclass' hidden members

      • The Pencil class overrides the toString method in Tool. When you run the Pencil class, you get "Generic Tool// I am a Pencil'
  8. Casting

    • Upcasting: casting an object to a parent class by assigning the object to a reference variable of the parent class
    • Downcasting:casting down an object a class down the inheritance hierarchy. You need to write the object in brackets. Subclass needs to exist in the parent class as a reference or else you get an error
  9. instanceof Keyword: used to test if a object is of a specified type. It is normally used an in if statement.

Imagens e arquivos do mapa

  • Inheritance
  • Inheritance
  • Inheritance
  • Inheritance
  • Inheritance
  • Inheritance
  • Inheritance
  • Inheritance
  • Inheritance

Informações

Descrição
Mapa Mental sobre Inheritance, criado por Jeremy Deleon em 06-08-2019.
Criado por
Jeremy Deleon
Visualizações
0
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?