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

Mindmap

Inheritance

Joyce Xie Englisch

Inhalt der Mindmap

Inheritance

  1. extending a class

    • creating a new class
      • child class/subclass of parent
        • opportunity to add functionality that does not exist in original
          • change behavior of existing class
  2. Extends Keyword

    • all java classes automatically extend the java.lang.Object class
      • Object = superclass
        • parent, by default is a subclass of Object
  3. Relationship

    • example: bird, fish, dog are all subclasses of animal
  4. Accessibility

    • within subclass, access superclass and protected methods and fields
      • cannot access superclass's private methods from subclass
  5. Method Overriding

    • override method to change behavior
      • override by writing new method in subclass
        • don't have to change anything in parent class
  6. Calling Superclass's constructors

    • Implicit calling to the parent's constructor that does not exist
      • compile error
        • compiler adds an implicit call to no argument constructor in Parent
  7. Calling the superclass's Hidden Members

    • using super to access hidden member
  8. Type Casting

    • FInal classes

Informationen

Beschreibung
Mindmap am Inheritance, erstellt von Joyce Xie am 21/11/2019.
Erstellt von
Joyce Xie
Aufrufe
0
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck