R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which collector can be used to produce a frequency map?

  • (A) Collectors.groupingBy(e -> e, Collectors.counting())
  • (B) Collectors.toMap()
  • (C) Collectors.summarizingInt()
  • (D) Collectors.mapping()
  • Correct Answer - Option(A)
  • Views: 8
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`groupingBy()` with `counting()` produces a frequency map of elements.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.