Exception Chaos Java Challenge

exception chaos

It's time to improve your Java skills with this Exception Chaos Java Challenge Quiz

Exception Chaos Java Challenge

Working properly with exceptions is crucial to a high-quality application that users enjoy using. This quiz reinforces some of the basic concepts of exceptions.

Therefore, what do you think will happen when running the following code?

exception chaos

To go deeper and know how to use Exceptions in a real project, you can read the following article:
11 Mistakes Java Developers Make when Using Exceptions

If you have any questions about this Java Challenge, don’t hesitate to leave a question!

Keep breaking your limits!

Written by
Rafael del Nero
Join the discussion

4 comments
    • Hi Zishan, I would need more context in your question. The principles to handle Exceptions are pretty much the same with any tool. Try to apply them in the same way with Apache Camel.

  • I think your explanation is wrong in one point: The FileNotFoundException will be caught in the outer try-catch-finally-block (the one that adds “exc” and “fin”). However, you state that the code execution “continues” and that the NPE is thrown and caught in that particular catch block. The line that throws the NPE will not be executed at all.
    The solution is still the same.