Mind map
inheritance
Map content
inheritance
- extending or subclassing declare subclasses final by saying final is-a relationshipparent child classes
distinguishes OOP languages
benefits
- add functionalities to original class
- change behaviors of original class
extend by writing extends after child class name and before parent
ex animals
legal to assign an instance of a subclass to a reference variable of the parent type.
can access public and protected just not private of parent class
override methods from the parent class
when you create a child object, all its parent classes are also instantiated.
you can call the parent’s constructor from a subclass’s constructor by using the super keyword, but super must be the first statement in the constructor.
you can cast an object to another type (Parent)
use if for instanceof
Information
- Description
- Mind Map on inheritance, created by Philip Mylet on 06/08/2019.
- Created by
- Philip Mylet
- Views
- 0
- Rating