Mindmap
FirstPart
Inhalt der Mindmap
FirstPart
the process of extending a class
- through
- "extends" keyword
- blocked through
- "final" keyword
- through
IS/A Relationship
- The subclass "is a" type of of its superclass
- The subclass inherits all public methods and fields of its superclass
- When assigning -> assign an instance of a subclass to a parent variable
- The subclass inherits all public methods and fields of its superclass
- The subclass "is a" type of of its superclass
Accessibility
- subclasses can access their superclass's public and protected methods ad fields
- HOWEVER, they cannot access their parent's private methods
- subclasses can access their superclass's public and protected methods ad fields
METHOD OVERRIDING
- Changing the behavior of a method in the parent class by writing in a subclass a method that has the SAME signature as the parent method
- You cannot override a final method
- You cannot override parent private methods because they aren't visible
CALLING SUPERCLASS CONSTRUCTORS
- When you create a child object, all its parent constructors are initiated
- "super" --> a direct superclass instance
- handy if you want to incvke another superclass constructor
- "super" --> a direct superclass instance
- When you create a child object, all its parent constructors are initiated
Informationen
- Beschreibung
- Mindmap am FirstPart, erstellt von Jazmine Gladney am 21/11/2019.
- Erstellt von
- Jazmine Gladney
- Aufrufe
- 0
- Bewertung