Which concept of C++ is used to reuse the written code?

2023

Which concept of C++ is used to reuse the written code?

  1. A.

    Polymorphism

  2. B.

    Inheritance

  3. C.

    Encapsulation

  4. D.

    More than one of the above

  5. E.

    None of the above

Attempted by 303 students.

Show answer & explanation

Correct answer: B

In C++, the concept used to reuse written code is inheritance. Inheritance allows a class to inherit properties and methods from another class, enabling the reuse of existing code without rewriting it. This promotes code efficiency and reduces redundancy.

Explore the full course: Up Lt Grade Assistant Teacher 2025