Question 1
EasyWhat is encapsulation?
- A.
Inheriting from several classes
- B.
Having many forms of one method
- C.
Breaking a program into files
- D.
Bundling data and the methods that act on it into one unit, and hiding the internal details
Show answer and explanation
Answer: D
A class exposes a public interface while keeping its fields private.