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

Mapa mental

Inheritance

Tate Johnson Computer Science Inglés

Contenido del mapa

Inheritance

  1. process of deriving a new class from an existing one.

  2. Super class cannot access child instance data or methods unless its public.

    • Child class CAN access PUBLIC data/methods of parents
      • Child class CANNOT access PRIVATE data/methods of parent
  3. Reserved word: extends

    • You can only extend ONE class.
  4. protected: can only be accessed by the child of the parent class

  5. Super: gives access to parent's data/methods

    • Called like: super() or super(value)
      • **If the first line in the Child's constructor is not a call to the parent class. Java implicitly places a super there. With no params**
        • Exception: a chained call to another constructor in same class will automatically defer super to that class.
          • super(xxx) --> call to parent class constructor
            • super.xxx --> call to parent class instance data
              • super.xxx() --> call to parent class method
  6. Overriding:

    • When a child class defines a method w/ the same name and signature as the parent. The child version overrides the parents.
      • How to implement: @Override before the method
        • *Static methods can be inherited but NOT overriden.

Información

Descripción
Computer Science Mapa Mental sobre Inheritance, creado por Tate Johnson el 27/04/2021.
Creado por
Tate Johnson
Visitas
2
Etiquetas
inheritance
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?