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

Mapa mental

Inheritance

Alyssa M. Inglés

Inheritance

Contenido del mapa

Inheritance

  1. The process of extending a class

  2. The child classes inherit all of the methods and fields of the parent class. The child classes can also have new methods and fields as well as the ability to override existing methods from the parent class.

    • Child classes can also be extended to become the "parent" class to another class
      • For a child class to inherit the methods and fields of the parent class, it should be declared using the extends keyword
        • When a class is created by inheritance, the superclass and subclass class have a "is-a" relationship
          • In this example: A Rectangle (Subclass) "is-a" Shape (Superclass) and a Triangle (Subclass) "is-a" Shape (Superclass)
        • Method Overriding
          • A subclass can override a method from its superclass by having a method of the same name and parameters within it
        • Method Overloading
          • A subclass can overload a method from its superclass by having a method of the same name and different within it
      • public class Parent{ }
        • public class Child1 extends Parent { }
        • public class Child2 extends Parent { }
      • This can be achieved using interfaces since a class can only extend one class in Java
    • A class can be declared as final if you no longer want it to be extendible or inherited by a subclass

Imágenes y archivos del mapa

  • Inheritance
  • Inheritance

Información

Descripción
Mapa Mental sobre Inheritance, creado por Alyssa M. el 21/11/2019.
Creado por
Alyssa M.
Visitas
0
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?