LearnFrenzy
Sign in Take a free test

Encapsulation · Encapsulation MCQ · Question 1

Which statement best defines encapsulation? Answer, explanation & discussion

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

Which statement best describes encapsulation?

  • A Deriving a class from another
  • B Bundling data with the functions that operate on it and hiding the data so the object controls its own state Correct
  • C Using one name for many functions
  • D Allocating objects dynamically
Correct Answer: Option B

Data hiding (private members) is the mechanism; the goal is that only the object's own functions can change its state.

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