← 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?
- A.Its key is always true/false and both keys are always present
- B.It can only produce a count
- C.It sorts the elements
- 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 →