Working with streams and lambda expressions
9 practice questions under this official exam objective (1Z0-819), each with the answer key, an option-by-option explanation and instant feedback.
Questions under this objective
9 total · page 1 of 1Java Stream reduce with Identity and Combiner
This question tests the behavior of the parallelStream reduce method when using an identity, accumulator, and combiner. The correct output is determin
Valid BiPredicate Lambda Parameter Syntax
This question tests the strict syntax rules for lambda parameters in Java, specifically regarding type inference with 'var' and the 'final' modifier.
Java Stream Match and FindFirst Results
This page analyzes the output of Java Stream methods allMatch, anyMatch, noneMatch, and findFirst on a list of strings. It establishes that the correc
Java Stream reduce with Identity vs Accumulator
This question tests the behavior of the three-argument reduce method in Java Streams. It establishes that providing an identity value to a parallel st
What Happens When You Sort a List Created with List.of()?
This 1Z0-819 fragment builds a flower list with List.of() and then attempts to sort it with a Comparator, so the exam tests whether you recognize that
Enum Switch Result with Unused Stream dropWhile
This question tests the interaction between an unused Stream dropWhile operation and a switch expression on an enum. The page establishes that the int
Effectively Final Variable Usage in Java Lambda Expressions
This question tests the rule that local variables accessed by lambda expressions must be effectively final. The code compiles and runs correctly becau
Which BiPredicate Lambda Declaration Using var Is Valid?
This 1Z0-819 item tests the Java lambda parameter syntax rules for var: a lambda that declares any parameter with var must use var on every parameter
Which Stream Method Finds an Item With count Below Zero?
This 1Z0-819 question asks which Stream pipeline correctly tests whether the items list contains at least one element whose count field is below zero.