Skip to content

Journey

why not….

  • Home
  • 2020
  • December
  • 31
  • If exceptions are not handled

If exceptions are not handled

Posted on December 31, 2020 By dion No Comments on If exceptions are not handled
Uncategorized

Exceptions should be handled in try catch blocks. If an exception is thrown but not handled by the program, then it is terminated midway.

Example:

I have an exception in method do2() which I don’t handle.

The program terminates as soon as the exception is thrown. do1() does not get a chance to execute:

However, If I handle the exception (even if it’s basic) everything works fine:

Post navigation

❮ Previous Post: Iaas, Paas, Saas
Next Post: How to extend disk space ubuntu ❯

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2025 Journey.

Theme: Oceanly by ScriptsTown