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

Which method correctly takes the result of one future and feeds it into a second asynchronous call WITHOUT producing a nested CompletableFuture<CompletableFuture<T>>?

CompletableFuture<Integer> first = CompletableFuture.supplyAsync(() -> 10); CompletableFuture<Integer> doubled = first./* ??? */(v -> CompletableFuture.supplyAsync(() -> v * 2));