LearnFrenzy
Sign in Take a free test

OOPS Concepts · OOPS Concepts MCQ · Question 8

Who can access protected members? Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 8 Back to Exercise

Which code can access a protected member of class Base?

  • A Any code
  • B Member functions of Base and of classes derived from Base (and friends) Correct
  • C Only main()
  • D Only Base's constructors
Correct Answer: Option B

protected sits between public and private: hidden from outside code, visible to derived classes.

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