Courseiva
Working with Streams and Lambda ExpressionseasyMultiple ChoiceObjective-mapped

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

Which of the following is a terminal operation of the Stream API?

⚠ Common exam trap

Candidates often confuse peek() with forEach() because both can perform actions on elements, but peek() is intermediate and does not trigger stream processing, while forEach() is terminal and does.

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 correct because it is a terminal operation in the Stream API. Terminal operations produce a result or side effect and close the stream, meaning no further operations can be performed on the same stream. forEach() consumes each element of the stream and returns void, making it a terminal operation.

Answer analysis

Option-by-option breakdown

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

  • map()

    Why it's wrong here

    map() is an intermediate operation.

  • forEach()

    Why this is correct

    Correct. forEach() is a terminal operation.

  • filter()

    Why it's wrong here

    filter() is an intermediate operation.

  • peek()

    Why it's wrong here

    peek() is an intermediate operation.

About these practice questions

Courseiva writes every 1Z0-829 question from scratch — 513 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.