🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Java Streams in Depth: all 10 questions

Quiz: Java Streams in Depth · Question 6 of 10

Which identity value is correct for reduce when multiplying numbers?

Which identity value is correct for reduce when multiplying numbers?

  1. A.0
  2. B.1
  3. C.-1
  4. D.Integer.MAX_VALUE
Answer & explanation

Correct answer: 1

The identity must not change the result: x * 1 = x. Starting from 0 would make every product 0.

Can you get the rest right without peeking?

Take the timed Quiz: Java Streams in Depth quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →