🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Java Concurrency Utilities: all 10 questions

Quiz: Java Concurrency Utilities · Question 9 of 10

In a CompletableFuture chain, a stage throws an exception. What happens to the next thenApply?

In a CompletableFuture chain, a stage throws an exception. What happens to the next thenApply?

  1. A.It runs with a null value
  2. B.It is skipped, and the error goes to exceptionally (or to join, which throws)
  3. C.The program stops immediately
  4. D.It runs again from the start
Answer & explanation

Correct answer: It is skipped, and the error goes to exceptionally (or to join, which throws)

Failed results skip normal stages until a handler such as exceptionally or handle deals with them.

Can you get the rest right without peeking?

Take the timed Quiz: Java Concurrency Utilities quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →