LearnFrenzy
Sign in Take a free test

Concurrency and Executors · Concurrency and Executors MCQ · Question 11

Recovering from a failed CompletableFuture Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 11 Back to Exercise

What does .exceptionally(ex -> fallback) do?

  • A Throws ex
  • B Returns the fallback value if the previous stage failed; otherwise passes the result through Correct
  • C Retries the task
  • D Logs and ignores
Correct Answer: Option B

handle receives both the result and the exception.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links