Question:medium

In object-oriented programming, what is encapsulation?

Show Hint

Encapsulation is about hiding the internal details of an object and providing controlled access to its properties and methods.
Updated On: Jan 16, 2026
  • Combining data and methods into a single unit
  • Hiding the implementation details of a class
  • Inheriting properties from a parent class
  • Allowing multiple forms of a method
Show Solution

The Correct Option is B

Solution and Explanation

In object-oriented programming (OOP), encapsulation is the technique of packaging data (variables) and the methods (functions) that manipulate that data into a single entity known as a class. A key aspect of encapsulation is controlling access to an object's internal components, typically by designating certain properties or methods as private. This practice conceals the internal workings of the object from external entities.
- Bundling data and methods into a single unit (A) generally describes encapsulation, but its primary emphasis is on obscuring implementation details (B).
- Acquiring properties from a parent class (C) is known as inheritance, not encapsulation.
- Enabling a method to take on multiple forms (D) is termed polymorphism, not encapsulation.
Therefore, (B) is the accurate selection.
Was this answer helpful?
0


Questions Asked in CUET (UG) exam