•To handle an exception, you use a try catch block try
–{
– (try block statements...)
–}
–catch (ExceptionType
ParameterName)
–{
– (catch block statements...)
–}
•try block contains code
that might cause an exception to occur
•catch indicates the
exception that you expect to catch and how you want to handle it.