Enter the Multi-Verse! 🕷
Polymorphism describe the ability for an object to have multiple implementations for the same behaviour.
🤝 This can be accomplished by having different classes related to each other through
As we have found in the previous post on inheritance, we can use the
@Override annotation to provide a custom implementation for a parent method.
For example, think of an
Animal parent class that has a method called
eat(). Children classes of
Animal could be
♻️ They also have their own way of eating (some may be vegetarian, others not, etc.)