← 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?
- A.It runs with a null value
- B.It is skipped, and the error goes to exceptionally (or to join, which throws)
- C.The program stops immediately
- 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 →