R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which method in Stream API is used for aggregation?

  • (A) map()
  • (B) filter()
  • (C) collect()
  • (D) peek()
  • Correct Answer - Option(C)
  • Views: 8
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`collect()` is a terminal operation used to aggregate stream elements.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.