R

Ram Sharma • 3.40K Points
Extraordinary

Q. What is the purpose of `Collectors.groupingBy()`?

  • (A) To filter elements in a stream
  • (B) To sort stream elements
  • (C) To group elements by a classifier function
  • (D) To merge multiple streams
  • Correct Answer - Option(C)
  • Views: 10
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`groupingBy()` groups elements by the result of a classifier function into a Map.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.