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

If the upstream CompletableFuture completes exceptionally, which of these stages still runs its callback?

cf.thenApply(this::transform) // (1) .exceptionally(ex -> fallback) // (2) .thenAccept(this::consume) // (3) .whenComplete((v, ex) -> log(ex)); // (4)