Multiple choice technology programming languages

Following functionality in C++ violates the encapsulation.

  1. Pointers

  2. Friend Function

  3. Access Specifiers

  4. None

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

A friend function in C++ is granted access to the private and protected members of a class. Because it bypasses the standard access control restrictions, it violates the core object-oriented principle of encapsulation.