Skip to content
Sharp

Concurrency basics · interview question

Which method should you use to ensure a CompletableFuture chain executes on a specified Executor?

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

Correct answer

A. .thenApplyAsync()

Why

The thenApplyAsync() method allows you to specify an Executor on which the function will be executed, ensuring that the CompletableFuture chain runs on the desired thread pool.

Test yourself on Concurrency basics

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

Start free test
All Concurrency basics questions →