Multiple choice

Inheritance is used to

  1. reuse code

  2. add functionality

  3. both (1) and (2)

  4. none of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Inheritance allows derived classes to reuse code from base classes AND add new functionality, combining both benefits. This promotes code reuse and extensibility.