Skip to content
Sharp

Concurrency basics · interview question

Which CompletableFuture method allows performing an action upon completion of a future without returning a result?

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

Correct answer

A. .thenAccept()

Why

The thenAccept() method allows you to perform an action upon the completion of a CompletableFuture without returning a result. It is used for side-effect actions such as logging.

Test yourself on Concurrency basics

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

Start free test
All Concurrency basics questions →