A

Admin • 832.27K Points
Coach

Q. Which stream operation is best suited to calculate the average of a list of numbers?

  • (A) reduce()
  • (B) collect(Collectors.summingInt())
  • (C) mapToInt().average()
  • (D) count()

Explanation by: Admin

`mapToInt().average()` calculates the average and returns an OptionalDouble.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.