Courseiva
Question 90 of 513
Working with Streams and Lambda ExpressionseasyMultiple ChoiceObjective-mapped

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

Which functional interface is most appropriate for a lambda that takes a String and returns nothing?

⚠ Common exam trap

The trap here is that candidates mistakenly choose `Function<String, Void>` thinking `Void` represents 'nothing', but `Void` is a class that requires a return value of `null`, making it unsuitable for a lambda that truly returns nothing.

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

Consumer<String>

A lambda that takes a String and returns nothing matches the `Consumer<String>` functional interface, which has a single abstract method `void accept(String t)`. `Consumer` is designed for operations that consume an input and produce no output, such as printing or logging the string.

Answer analysis

Option-by-option breakdown

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

  • Predicate<String>

    Why it's wrong here

    Predicate returns a boolean.

  • Function<String, Void>

    Why it's wrong here

    Function returns a value; returning Void is possible but uncommon and requires explicit null return.

  • Supplier<String>

    Why it's wrong here

    Supplier supplies a value, takes no input.

  • Consumer<String>

    Why this is correct

    Consumer<String> accepts a String and returns void, best suited for side-effect operations.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

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 →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jul 4, 2026

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.

Loading comments…

Sign in to join the discussion.

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.