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

Mindmap

Chapter 6

Ralph Eubanks Englisch

Inhalt der Mindmap

Chapter 6

  1. INHERITANCE

    • Inheritance is what makes code extensible in any OOP language
    • The process of extending a class
      • extend a class by using the "extends" keyword in class declaration
      • extending a class is known as inheriting / subclassing
        • use the "final" keyword to prevent classes from being subclassed
        • extend a class by creating a new class
          • "new" keyword creates an instance of a subclass
            • keyword "super" represents an instance of the direct superclass of the current object
              • you can explicitly call the parents constructor from a subclass’s constructor with super keyword, super must be first statement in the constructor
              • super can call a hidden member or an overridden method in a superclass
            • "instanceof" keyword used to test if an object is of a specified type typically used in an if statement
        • subclass inherits all public methods and fields of its superclass
          • you can access a superclass public and protected methods and fields within the subclass, but you cannot access the private methods
        • method overriding - changing the behavior of a method in the parent class by writing in a subclass a method with the same signature as a method in the superclass
          • method overloading - only the name is the same but the list of arguments is not
      • “is-a” relationship is when you create a new class by inheritance
    • Gives you the opportunity to add functionality that does not exist in the original class
    • gives you the chance to change the behaviors of the existing class to better suit your needs

Informationen

Beschreibung
Mindmap am Chapter 6, erstellt von Ralph Eubanks am 26/11/2019.
Erstellt von
Ralph Eubanks
Aufrufe
0
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck