R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which collector is used to get the average of stream elements?

  • (A) Collectors.avg()
  • (B) Collectors.mean()
  • (C) Collectors.averagingInt()
  • (D) Collectors.summarize()
  • Correct Answer - Option(C)
  • Views: 8
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`Collectors.averagingInt()` returns the average of int values from the stream.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.