Q:

What are the advantages of inheritance in c++?

0

What are the advantages of inheritance?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Answer:

There are many benefits of inheritance in C++, so let us see them:

  • Inheritance provides code reusability, makes it easier to create and maintain an application. So we don’t have to write the same code again and again.
  • It allows us to add more features to a class without modifying it.
  • It is transitive in nature, which means that if class B inherits from another class A, then all the subclasses of B would automatically inherit from class A.
  • Inheritance represents real-world relationships well.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now