R

Ram Sharma • 3.40K Points
Extraordinary

Q. What is the return type of `collect()`?

  • (A) Optional
  • (B) Stream
  • (C) Depends on collector
  • (D) Iterator
  • Correct Answer - Option(C)
  • Views: 9
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`collect()` returns a result based on the collector passed (e.g., List, Set, Map).

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.