Mind map
Inheritance
Map content
Inheritance
Extends: Extends a class when placed in class declaration.
"Is-a" relationship: Connects a subclass to a superclass.
Subclass: Inherits all the public methods of it's superclass.
Same Package: If a superclass and a subclass are in the same package, you can access the superclass's default methods and fiends, not just its public methods.
Protected Methods: Cannot be accessed from outside unless by a subclass.
Method Overriding: When you change the behavior of a method in the parent class.
Super: Represents an instance of the direct superclass of the current object.
Constructors:
- Sub: Calls the single argument constructor of the parent class
- Base
Hidden Members: Hidden members or overridden methods in the superclass can be called by the super keyword.
Type Casting:
- Upcasting: When an object is casted to a parent class.
- Downcasting: When an object is casted down a class in the inheritance heirarchy.
Final: Prevents others from extending a class.
"Instanceof": This keyword can be used to test if an object is of a specified type.
Information
- Description
- Mind Map on Inheritance, created by Bryce Gatt on 21/11/2019.
- Created by
- Bryce Gatt
- Views
- 0
- Rating