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

If the supplier passed to CompletableFuture.supplyAsync throws an unchecked exception, what does calling join() on the returned future do?

CompletableFuture<Integer> cf = CompletableFuture.supplyAsync(() -> { throw new IllegalStateException("boom"); }); cf.join();