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

Mapa mental

Inheritance

Alyssa M. Inglês

Inheritance

Conteúdo do 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

Imagens e arquivos do mapa

  • Inheritance
  • Inheritance

Informações

Descrição
Mapa Mental sobre Inheritance, criado por Alyssa M. em 21-11-2019.
Criado por
Alyssa M.
Visualizações
0
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?