Question discussion

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

359240Medium DSSSB TGT Computer Science 0 replies 0 views
0
What is the objective of encapsulation in object-oriented programming?
  • ATo create multiple instances of a class
  • BTo enable one class to inherit from another class
  • CTo allow objects to take multiple forms
  • DTo combine data and methods that operate on that data within a single unit
Correct answer: D

Explanation

Encapsulation bundles data and the methods that operate on it into a single unit (class).

Discussion 0

Nobody has replied yet. Start the discussion!