Multiple choice

The use of friend function lessens the value of which of the following OOP features?

  1. Open recursion

  2. Inheritance

  3. Encapsulation

  4. Class based programming

  5. Dynamic dispatch

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

Too many functions or external classes declared as friends of a class with protected or private data may lessen the value of encapsulation of separate classes in object-oriented programming and may indicate a problem in the overall architecture design.