🎙 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 5 of 10

What is special about partitioningBy compared with groupingBy?

What is special about partitioningBy compared with groupingBy?

  1. A.Its key is always true/false and both keys are always present
  2. B.It can only produce a count
  3. C.It sorts the elements
  4. D.It runs in parallel
Answer & explanation

Correct answer: Its key is always true/false and both keys are always present

partitioningBy splits by a condition into exactly two groups, true and false, even if one is empty.

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 →