Have you ever heard of SOLID? 🤔 Let's look at the 'L: Liskov Substitution Principle (LSP)' of it.
As per the book's definition:
Objects of a superclass should be replaceable with objects of its subclasses without breaking the application.
It means consider the following example:
class Bird {
public void fly() {
System.out.println(...
iamgautam.hashnode.dev2 min read