LearnFrenzy
Sign in Take a free test

Encapsulation · Encapsulation MCQ · Question 18

Encapsulation vs abstraction Answer, explanation & discussion

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

Which pairing is correct?

  • A Encapsulation: interfaces; abstraction: private data
  • B Encapsulation: hiding data and protecting state; abstraction: exposing only essential behaviour and hiding implementation complexity Correct
  • C They are the same thing
  • D Encapsulation is only for structs
Correct Answer: Option B

They complement each other: an abstract interface (abstraction) implemented by classes with private data (encapsulation).

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