Skip to content
Sharp

Concurrency basics · interview question

Which CompletableFuture method allows you to execute a task asynchronously and return its result?

Multiple choiceEasychapter-15-curatedpremiumconcurrencycompletablefuture
Choose one answer
Answer and explanation

Correct answer

C. SupplyAsync()

Why

The supplyAsync() method is used to run a task asynchronously and provides a result upon completion. It is suitable for operations that return a value.

Test yourself on Concurrency basics

A free test with instant, explained results. No account needed.

Start free test
All Concurrency basics questions →