1.

What is inheritance? Mention its advantages.

Answer»

In object-oriented programming, inheritance is a way to form new classes using classes that have already been defined.

1. Reusability:
Inheritance helps the code to be reused in many situations.

2. Saves Time and Effort:
Since the main code is written can be reused in various situations as heeded.

3. Easy Maintenance:
The different part of the programs written in C++ can be easily maintained due to the features of Inheritance, polymorphism, dynamic binding, etc.,

4. Easy to extend:
The programs can be extended with new features by adding very easily.

5. Memory utilisation:
Due to the feature of dynamic binding and dynamic memory allocation (new and delete), memory can be efficiently used.



Discussion

No Comment Found

Related InterviewSolutions