ITPEC FE Subject A April 2026 Question 37
Which of the following is an appropriate explanation of encapsulation in object orientation?
Explanation
Bundling data with its procedures in one object and hiding the implementation — that is encapsulation.
An object holds its data (attributes) together with the procedures (methods) that operate on it, and the outside world reaches them only through the object's public interface. Because the internals are hidden, they can change without affecting the code that uses the object; this concealment is also called information hiding.
Answer (b)
Why not others:
- •(a) — abstracting and grouping objects with common properties is classification, the idea behind a class
- •(c) — extracting the properties common to several classes into a base class is generalization
- •(d) — a subclass taking on the properties of its base class is inheritance
Key rule: Encapsulation concerns the boundary around a single object; classification, generalization and inheritance concern relationships between objects and classes.
System Development Technology · AI-written, may contain errors
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.