Mapa mental
Inheritance
Conteúdo do mapa
Inheritance
what makes the code accessible in any OOP language
the process of extending a class
- can create a new class that will have a "parent child" relationship with the original
- child class can be extended too until you specifically declare it as final
- use EXTENDS keyword, after the class name and before parent class
- can create a new class that will have a "parent child" relationship with the original
special "is-a" relationship created when extending a class
- then can assign instance of subclass to a reference variable of the parent type
from within subclass, can access a superclass public methods but not private
you can override a method by writing new method in subclass, except a final method
- if you do not explicitly write a constructor for a subclass, the compiler will implicitly add a no argument constructor
- can use super keyword to call a hidden method in addition to helping implicitly write constructors
can cast instance of subclass to its parent class
Informações
- Descrição
- Mapa Mental sobre Inheritance, criado por Katie Arnott em 21-11-2019.
- Criado por
- Katie Arnott
- Visualizações
- 0
- Avaliação