Question 36Asked in DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 1 (9:00 AM)

What is the objective of encapsulation in object-oriented programming?

  1. ATo create multiple instances of a class
  2. BTo enable one class to inherit from another class
  3. CTo allow objects to take multiple forms
  4. DTo combine data and methods that operate on that data within a single unit
Show answerHide answer

Correct answer: (D) To combine data and methods that operate on that data within a single unit

Explanation

Encapsulation bundles data and the methods that act on it into one unit (class) and hides internal details. Inheritance and polymorphism are options B and C.

From DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 1 (9:00 AM)

This is question 36 of DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 1 (9:00 AM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.