...

/

Advantages of Inheritance

Advantages of Inheritance

In this lesson, you'll get to know the advantages of using inheritance.

We'll cover the following...

Reusability

Inheritance makes the code reusable. Consider that you are designing a banking system using classes. Your model might have these:

  • A base BankAccount class
  • A derived class named SavingsAccount
  • A derived class named CheckingAccount

In the above example, you don’t have to re-declare the fields nor do you have to re-code for the Deposit() ...