GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Mindmap

Inheritance

Vincente Squitiro Englisch

Inhalt der Mindmap

Inheritance

  1. Relationship between classes

    • Parent
      • Other names
        • Superclass
        • Base Class
    • Child
      • Other names
        • Subclass
        • Derived class
      • Can access the parents methods and fields that are...
      • Can overwrite the parents methods and fields that are...
    • Child inherits the methods of the parent
    • Child can add functionality that doesn't exist in the parent
    • The parent class' constructor is called when the child class is initialized, the parent class's parent is called, etc.
  2. Keywords

    • extends
      • Used to extend a class
      • All Java classes automatically extend the java.lang.object class
    • super
      • Represents an instance of the direct parent class
      • The child class can use to call the parent class' overwritten or hidden members
    • final
      • Prevents a class from being extended
    • instanceof
      • Used to determine if an object is of a specified type
  3. The behavior of the child class can be changed to address needs that the parent class does not (overwriting)

  4. A child class can only extend one direct parent class

  5. The child and parent have an "is a" relationship: the child "is a" version of the parent

  6. Accessibility

    • public
    • protected
    • default (only if the same package)
  7. Child classes can be "upcast": defined as the parent class' type

Informationen

Beschreibung
Mindmap am Inheritance, erstellt von Vincente Squitiro am 02/08/2019.
Erstellt von
Vincente Squitiro
Aufrufe
0
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck