R

Ram Sharma • 3.40K Points
Extraordinary

Q. What does `Collectors.toMap()` require to resolve duplicate keys?

  • (A) A list collector
  • (B) A filtering predicate
  • (C) A merge function
  • (D) A sorting function
  • Correct Answer - Option(C)
  • Views: 11
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`Collectors.toMap()` throws an exception on duplicate keys unless a merge function is provided.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.