Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumJavaCompletableFuture compositionSingle-choice MCQ

A stage is attached with the non-async `thenApply` to a future that is ALREADY complete by the time `thenApply` is called. On which thread does the supplied function run?

CompletableFuture<String> done = CompletableFuture.completedFuture("x"); done.thenApply(s -> { // which thread? return s.toUpperCase(); });