Information hiding is achieved through which OOP principle?
Answer options
A
Inheritance
B
Encapsulation
C
Typing
D
Hierarchy
Correct answer: Encapsulation
Explanation
Encapsulation achieves information hiding by bundling data (fields) and methods together in a class and restricting direct access to an object's internal state through access modifiers (private, protected). Inheritance relates to reuse; Typing and Hierarchy are not the primary OOP principle for information hiding.