Intermediate
Java
Q63 / 100
What is the purpose of Collections.unmodifiableList()?
Correct! Well done.
Incorrect.
The correct answer is C) Returns a view that throws UnsupportedOperationException on mutating operations
C
Correct Answer
Returns a view that throws UnsupportedOperationException on mutating operations
Explanation
unmodifiableList wraps a list so that add/remove/set throw UnsupportedOperationException. The underlying list can still be mutated through the original reference.
Progress
63/100