UGC-NET | UGC NET CS 2016 July – II | Question 13

Which one of the following is correct, when a class grants friend status to another class?
(A) The member functions of the class generating friendship can access the members of the friend class.
(B) All member functions of the class granted friendship have unrestricted access to the
members of the class granting the friendship.
(C) Class friendship is reciprocal to each other.
(D) There is no such concept.


Answer: (B)

Explanation:

  • When a class grants friend status to another class then all member functions of the class granted friendship have unrestricted access to the members of the class granting the friendship.
  • The member functions of the class generating friendship can access the members of the friend class.Incorrect statement.
  • Class friendship is not reciprocal to each other.

So, option (B) is correct.


Quiz of this Question

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.