Question OOP-ENC-0066
HardA Java class has a private List<String> field and a getter that returns it directly. What is the safest fix?
- A.
Return Collections.unmodifiableList(list) or a copy
- B.
Make the getter static
- C.
Sign up free to see the answer and a step-by-step explanation.