Question 111 of 513
1Z0-829 Working with Streams and Lambda Expressions Practice Question
Which three are terminal operations of the Stream interface? (Choose three.)
⚠ Common exam trap
In the OCP Java 17 exam, this question tests the distinction between intermediate and terminal operations. The trap is that candidates may confuse intermediate operations like filter and map (which are lazy and return streams) with terminal operations that produce a result or side effect and close the stream.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
reduce
(reduce) is correct because it is a terminal operation that processes all elements of a stream to produce a single result (e.g., sum, concatenation). Terminal operations trigger the stream pipeline execution and close the stream, after which no further operations can be performed.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
filter
Why it's wrong here
filter is an intermediate operation that selects elements based on a predicate.
- ✗
map
Why it's wrong here
map is an intermediate operation that transforms elements.
- ✓
reduce
Why this is correct
The `reduce` operation is a terminal operation because it processes all elements in the stream to produce a single, aggregated result (e.g., a sum or concatenation), thereby consuming the stream and preventing any further chaining of intermediate operations. This satisfies the constraint that a terminal operation must trigger the stream pipeline's execution and close the stream.
- ✓
forEach
Why this is correct
forEach is a terminal operation that performs an action on each element.
- ✓
collect
Why this is correct
collect is a terminal operation that accumulates elements into a collection or other result container.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jul 4, 2026
This 1Z0-829 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-829 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.