🟣 Inheritance
🟣 Downcasting
🟣 Upcasting
🟣 Abstraction
Everytime you see a code commented between
/* text */
means an explanation to some piece of code
or to the subject that I've learned, it's for me to remember.
When you see a code commented in this way,
// code
it's a piece of code that I commented because
I'm not using it anymore, but I want in there to know how it
works.
It's important for you to know that this repository have subjects
from a series of classes, this is why I have a lot of code commented.
Only for study and practice purposes.
In inheritance I've learned the advantages to use and how.
🪄 Upcasting:
Common use: Polymorphism.
It's a casting of subclass to superclass
🪄 Downcasting:
Common use: Methods that receive generics parameters.
It's a casting of superclass to subclass.
You have to use the key instanceof
Can't be instantiated. Way to guarantee full inheritance.