Skip to content
Sharp

Networking · interview question

In Java's CompletableFuture, which method can be used to combine multiple asynchronous tasks?

Multiple choiceMediumchapter-11-curatedpremiumnetworkingtimeouts-and-retries
Choose one answer
Answer and explanation

Correct answer

C. ThenCombine()

Why

thenCombine() is used to combine two CompletableFutures, allowing you to perform actions once both futures have completed. This is particularly useful when dealing with results from multiple asynchronous operations.

Test yourself on Networking

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

Start free test
All Networking questions →