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

Mapa mental

Inheritance

John Hair Inglés

Contenido del mapa

Inheritance

  1. Hierarchies

    • Parent Class: Also known as the super class, gives the child class (sub class) methods and variables.
    • Child Class: Also known as the sub class, it takes the methods and variables from the super class. Thanks to polymorphism, can be casted to the super class type. It uses the extends keyword.
  2. Inheriting Fields and Methods

    • Sub classes automatically inherit methods and fields. You can not use the same name for a instance variable that is already used in the super class, but you can overwrite a method to fit the sub class better.
  3. Subclass construction

    • Created just like a regular class, but uses the extends keyword followed by the
  4. Converting between subclasses and superclasses: Objects of Subclasses can convert to superclasses, but objects of super classes can not be converted to sub classes.

  5. Super(): is used in the constructor of the child class to give the parent class the required parameters

  6. Abstract Classes: Classes that have one or more abstract methods with at least one regular method. When a sub class extends an abstract class, they must write the code for the abstract methods.

  7. Access control

    • Public: Available to all classes in the same package
    • Private: Available to only the class it is created in, requires accessor method to get.
    • Protected: Protected data in an object can be accessed by the methods of the object’s class and all its subclasses.
  8. Super: keyword that can be used to call methods of the superclass

  9. Object Super class: Default extension when creating a class. Methods can be overwritten.

    • toString: returns a string of the location in memory
    • equals: sees if the two objects have the same location in memory

Información

Descripción
Mapa Mental sobre Inheritance, creado por John Hair el 03/05/2018.
Creado por
John Hair · may 2018
Actualizado
3 may 2018
Visitas
0
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?