LearnFrenzy
Sign in Take a free test

Classes and Objects · Classes and Objects MCQ · Question 19

Is friendship inherited or mutual? Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
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!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links