R

Ram Sharma • 3.40K Points
Extraordinary

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

  • (A) It returns a Set of elements
  • (B) It returns a Map of elements
  • (C) It collects elements into a List
  • (D) It converts elements to a String
  • Correct Answer - Option(C)
  • Views: 9
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`Collectors.toList()` collects stream elements into a List.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.