R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which method collects elements into a `Set`?

  • (A) Collectors.toSet()
  • (B) Collectors.toList()
  • (C) Collectors.groupingBy()
  • (D) Collectors.partitioningBy()
  • Correct Answer - Option(A)
  • Views: 2
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`Collectors.toSet()` collects stream elements into a `Set`.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.