R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which collector should be used for grouping and converting values to sets?

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

Explanation by: Ram Sharma
`groupingBy(..., toSet())` groups elements and collects each group into a set.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.