(the curly braces are required).
A try
block is:
one or more statements that are
executed, and
can potentially throw an exception.
The application will not halt if the try
block throws an exception.
After the try block, a catch clause appears
A catch
clause begins with the key word catch:
catch (ExceptionType
ParameterName)
ExceptionType is the name of an exception class
and
ParameterName is a variable name which will reference
the exception object if the code in the try
block throws an exception.
The code that immediately follows the
catch clause is known as a catch
block (the curly braces are required).
The code in the catch block is executed
if the try block throws an exception.