Multiple choice technology programming languages

Which of the following are true statements?

  1. Encapsulation is a form of data hiding.

  2. A tightly encapsulated class is always immutable.

  3. Encapsulation is always used to make programs run faster.

  4. Encapsulation helps to protect data from corruption.

  5. Encapsulation allows for changes to the internal design of a class while the public interface remains unchanged.

Reveal answer Fill a bubble to check yourself
A,D,E Correct answer
Explanation

Encapsulation hides internal implementation and protects data from unauthorized access (A, D). It allows internal changes without breaking public contracts (E). Encapsulation is not about performance (C) and does not require immutability (B).