LearnFrenzy
Sign in Take a free test

Inheritance · Inheritance MCQ · Question 4

Are private base members inherited? Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 4 Back to Exercise

What happens to a private data member of the base class in a derived object?

  • A It is not part of the derived object
  • B It exists in the derived object but cannot be accessed by the derived class's own member functions Correct
  • C It becomes protected
  • D It becomes public
Correct Answer: Option B

The memory is there (sizeof includes it) and base member functions still use it, but the derived class cannot name it.

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