A

Admin • 831.35K Points
Coach

Q. Which collector is used to partition a stream into two groups?

  • (A) Collectors.toMap()
  • (B) Collectors.groupingBy()
  • (C) Collectors.partitioningBy()
  • (D) Collectors.dividingBy()

Explanation by: Admin
`partitioningBy()` splits the stream into two groups based on a predicate.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.