Paul's Programming Notes
PostsRSSGithub

Java Exceptions - Catching All Errors

22 Jan 2013

“Exception is the base class for all exceptions”

“Thus any exception that may get thrown is an Exception (Uppercase ‘E’).”

Meaning, catch(Exception e) will catch any type of exception that is thrown, as opposed to specific Exceptions.

Example:

try {
    // code
}catch(Exception e)
{
    //catch all exceptions
}

http://stackoverflow.com/questions/1075895/how-can-i-catch-all-the-exceptions-that-will-be-thrown-through-reading-and-writi

java

Related posts

  • Exception in thread "main" java.lang.NoClassDefFoundError - Java 07 Jan 2014
  • Java - Swing's Nimbus Look & Feel 01 Feb 2013
  • Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object 14 Sep 2012
© 2026. All rights reserved.