Which concept of C++ is used to reuse the written code?
2023
Which concept of C++ is used to reuse the written code?
Answer: B. Inheritance — 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…
- A.
Polymorphism
- B.
Inheritance
- C.
Encapsulation
- D.
More than one of the above
- E.
None of the above
Attempted by 753 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.
Loading lesson…