R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which collector would you use to count the number of elements grouped by a key?

  • (A) groupingBy(..., counting())
  • (B) groupingBy(..., mapping())
  • (C) groupingBy(..., toList())
  • (D) groupingBy(..., reducing())
  • Correct Answer - Option(A)
  • Views: 3
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`groupingBy(..., counting())` creates a frequency map by counting elements per group.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.