R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which collector allows changing both value transformation and map type?

  • (A) toMap(keyMapper, valueMapper)
  • (B) toMap(keyMapper, valueMapper, mergeFunction)
  • (C) toMap(keyMapper, valueMapper, mergeFunction, mapSupplier)
  • (D) groupingBy(keyMapper)
  • Correct Answer - Option(C)
  • Views: 15
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`toMap()` has an overload that accepts a key mapper, value mapper, merge function, and a map supplier.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.