Mind map
Inheritance
Map content
Inheritance
You can extend a class with the "extends" command. A class can only extend one other class.
A subclass inherits all public methods of its superclass. However, all private methods in the superclass are not accessible by the subclass.
You cannot access a protected method of a superclass from a subclass (ex. subclass.protectedmoethod()) .
You can overload a method in the parent class by writing a method in the child class that has the same name but different functionality.
You can override a method by writing a method in the child class with the same signature as a method in the parent class. This changes the behavior of the method in the parent class.
You can only cast an object from a subclass to its superclass.
Inheritance allows you to add functionality that doesn't already exist in the class
A subclass is a special type of its superclass
When you create a child object, all parent classes are also initiated.
You can prevent classes from extending a class by making it a final class.
Information
- Description
- Mind Map on Inheritance, created by Tyler Stephens on 21/11/2019.
- Created by
- Tyler Stephens
- Views
- 2
- Rating