R

Ram Sharma • 3.40K Points
Extraordinary

Q. What is the purpose of `Collectors.unmodifiableList()` in Java 10+?

  • (A) Returns a synchronized list
  • (B) Returns a modifiable list
  • (C) Returns a list that can't be changed
  • (D) Returns an array
  • Correct Answer - Option(C)
  • Views: 7
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`unmodifiableList()` returns an immutable list from stream elements.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.