logo

Question detail

Explain encapsulation and give one reason why the object-oriented paradigm uses it. Your answer should also distinguish encapsulation from instantiation.

Try the question, check the answer, then read the explanation to understand the curriculum point.

At a glance

Question

Type

practice

Style

Topic

Programming paradigms

Exam-style question

Try this first

Explain encapsulation and give one reason why the object-oriented paradigm uses it. Your answer should also distinguish encapsulation from instantiation.

Model answer

What a good answer should say

  • Encapsulation is the organisation of data and the methods that operate on it within a class, with access controlled using visibility such as public, private or protected.
  • It helps keep implementation details controlled and supports the design principle of encapsulating what varies.
  • Instantiation is different: it is the creation of an object based on a class using a constructor.

Explanation

Why this works

A complete answer identifies encapsulation as a class-based way of controlling access to attributes and methods, links it to managing variation or implementation details, and does not confuse it with creating an object. Instantiation specifically concerns creating an object from a class.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.