Question 13
Back to Exercise
Why is generating a public setter for every private field poor encapsulation?
- A It is slower
- B It lets callers change any value at any time, so the fields are effectively public Correct
- C Setters cannot be public
- D Fields must be final
Correct Answer: Option B
Add setters only where change is a valid operation.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!