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

Mapa mental

class extension

daniela rodriguez Espanhol

Conteúdo do mapa

class extension

  1. In the Java language, classes can be derived from other classes, thereby inheriting fields and methods from those classes.

    • Excepting Object, which has no superclass, every class has one and only one direct superclass (single inheritance).
    • A nested class has access to all the private members of its enclosing class—both fields and methods
  2. A class that is derived from another class is called a subclass (also a derived class, extended class, or child class).

    • he class from which the subclass is derived is called a superclass (also a base class or a parent class).
  3. Classes can be derived from classes that are derived from classes that are derived from classes, and so on, and ultimately derived from the topmost class, Object

    • Such a class is said to be descended from all the classes in the inheritance chain stretching back to Object.
  4. A subclass does not inherit the private members of its parent class.

    • if the superclass has public or protected methods for accessing its private fields, these can also be used by the subclass.
  5. The child can inherit all the methods and fields from its parent, but can then do its own thing.

    • extends is the keyword used to inherit the properties of a class. Following is the syntax of extends keyword.
  6. To create a sub class (child) from a Java super class (parent), the keyword extends is used. You then follow the "extends" keyword with the parent class you want to extend

  7. inheriance

    • Inheritance can be defined as the process where one class acquires the properties (methods and fields) of another
      • class Vehicle { protected String brand = "Ford"; // Vehicle attribute public void honk() { // Vehicle method System.out.println("Tuut, tuut!"); } } class Car extends Vehicle { private String modelName = "Mustang"; // Car attribute public static void main(String[] args) { // Create a myCar object Car myCar = new Car();

Informações

Descrição
Mapa Mental sobre class extension, criado por daniela rodriguez em 17-05-2019.
Visualizações
0
Histórico
  • Criado por daniela rodriguez · 15 mai 2019
  • Copiado por daniela rodriguez · 17 mai 2019
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?