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.

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

No comments:

Post a Comment