In object-oriented programming, by wrapping up characteristics and behavior…
2013
In object-oriented programming, by wrapping up characteristics and behavior into one unit, we achieve
- A.
Data abstraction
- B.
Data encapsulation
- C.
Data hiding
- D.
All of these
Attempted by 685 students.
Show answer & explanation
Correct answer: B
Encapsulation is the process of bundling an object's data (attributes) and the methods that operate on that data into a single unit (typically a class or an object), and controlling access to the internal details. How it is implemented: use classes/objects together with access modifiers (for example private, protected, public) to expose only the intended interface.