A

Admin • 828.03K Points
Coach

Q. What is returned by `reduce()` when no identity is provided and the stream is empty?

  • (A) 0
  • (B) null
  • (C) Optional.empty()
  • (D) IllegalStateException

Explanation by: Admin
`reduce()` without identity returns `Optional.empty()` when the stream is empty.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.