¡GoConqr estrena diseño! Cuéntanos qué te parece.

Mapa mental

Inheritance

Jeremy Deleon Inglés

Inheritance

Contenido del 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.

Imágenes y archivos del mapa

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

Información

Descripción
Mapa Mental sobre Inheritance, creado por Jeremy Deleon el 06/08/2019.
Creado por
Jeremy Deleon
Visitas
0
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?