Question 9Asked in UGC NET Computer Science, June 2014 (Paper II & III, Selected Questions)

A friend function can be used to

  1. Aavoid arguments between classes.
  2. Ballow access to classes whose source code is unavailable.
  3. Callow one class to access an unrelated class.
  4. Dnone of the above
Show answerHide answer

Correct answer: (C) allow one class to access an unrelated class.

Explanation

Unrelated class means the classes are not connected via inheritance. But a relation can be achieved between two unrelated classes through friend function.

From UGC NET Computer Science PYQ, June 2014 (Paper II & III, Selected Questions)

This is question 9 of UGC NET Computer Science PYQ, June 2014 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.