Question 19
Back to Exercise
Class A declares friend class B;. Which statement is true?
- A A can access B's private members too
- B B can access A's private members; friendship is not mutual, not inherited and not transitive Correct
- C Classes derived from B can access A's private members
- D A and B become one class
Correct Answer: Option B
Friendship is granted one way by the class that declares it, and only to the named class.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!