/inheritance

This repository it's just for study purposes. Inheritance, downcasting, upcasting and abstract classes.

Primary LanguageJava

About the project

⚠️ This repo it's just for study purposes.

🚩 Subjectives

🟣 Inheritance
🟣 Downcasting
🟣 Upcasting
🟣 Abstraction

🚩 Understanding comments

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.

🎈 Repository content 🎈

✨ Inheritance

In inheritance I've learned the advantages to use and how.

The model implemented:
inheritance.png

✨ Upcasting and Downcasting

🪄 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

The model implemented:
up-down-casting.png

✨ Abstraction

Can't be instantiated. Way to guarantee full inheritance.

The model implemented:
abstraction.png