Courseiva
Working with Streams and Lambda ExpressionseasyMultiple SelectObjective-mapped

1Z0-829 Working with Streams and Lambda Expressions Practice Question

Which TWO of the following are terminal operations on a stream? (Choose two.)

⚠ Common exam trap

Many exam-takers confuse intermediate operations like `distinct`, `filter`, and `map` with terminal operations because they also process elements, but they do not produce a final result or side effect that terminates 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

forEach

`forEach` is a terminal operation that consumes the stream, applying the provided action to each element and producing a side effect without returning a new stream. Option C is correct because `reduce` is a terminal operation that combines stream elements into a single result using an associative accumulation function, terminating the stream pipeline.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • forEach

    Why this is correct

    forEach is a terminal operation that performs an action on each element.

  • distinct

    Why it's wrong here

    distinct is an intermediate operation that removes duplicates.

  • reduce

    Why this is correct

    reduce is a terminal operation that performs a reduction on elements.

  • 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.

About these practice questions

One of 513 original 1Z0-829 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.