Reusability
Inheritance makes the code reusable. Consider that you are up for designing a banking system using classes. Your model might have these:
A parent class: BankAccount
A child class: SavingsAccount
Another child class: CheckingAccount
In the above example, you don’t need to duplicate the code for the deposit() and withdraw() methods inside the child classes, namely SavingsAccount and CheckingAccount. In this way, you can avoid the duplication of code.