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

Mapa mental

Inheritance

Jada Matthews Inglês

Conteúdo do mapa

Inheritance

  1. Overview

    • An important feature in OOP used to extend a class.
      • Use the "extends" keyword after class name and before parent
        • Example: public class Child extends Parent{}
          • Multiple inheritance is allowed in C++ unlike JAVA.
    • Parent-Child Relationship between classes.
      • The child class can be extendable until you declare it as "final"
        • Use "final" keyword to prevent classes from being subclassed or extended.
    • Allows you to change behaviors of an existing class to better suit your needs.
  2. "Is-A Relationship"

    • A special relationship between the superclass and the subclass.
      • Superclass being a big class and the subclasses are the different types of the superclass.
      • Must not assign an instance of a subclass to a reference variable of the parent type.
      • A subclass inherits all public methods and fields from the superclass.
  3. Accessibilty

    • Have access to superclass's public methods and fields.
  4. Method-Overiding

    • By extending a class, you change the method's behavior within the parent class.
    • Write in the subclass a method that has the same signature as it does in the parent class.
    • Method-Overloading
      • Only the name is the same, and the list of argument isn't.
    • You can not override a final method
  5. Type Casting

    • Cast an object to another type
      • Only can cast an instance of a subclass to its parent.
    • Casting an object to a parent class is called upcasting.

Informações

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

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?