Tuesday, January 22, 2013

Java Exceptions - Catching All Errors

"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.

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


No comments:

Post a Comment