Computer Science, asked by Tiba48, 3 months ago

Advantages of inheritance​

Answers

Answered by MrTSR
4

\bold{Advantages\:of\:Inheritance:-}

______________________

(i) Reusability -

  Inheritance helps the cσde to be reused in many situations. The base class is defined and once it is compiled, it needs not to be reworked. Using the concept of inheritance, the programmer can create as many derived class from the base class as needed, while adding specific features to each derived class as needed.

(ii) Saves Time and Effort -

   The above concept of reusability, achieved by inheritance, saves the programmer's time and effort since, the main cσde written can be reused in various situations as needed.

(iii) Data Hiding -

    Base class can decide to keep some data private so that it cannot be altered by the derived class.

(iv) Transitivity -

     If a class B inherits properties of another class A, then all subclasses of class B will automatically inherit the properties of A. This is called transitive property.

Similar questions