If an error occurs, then Java is said to throw an exception. Whenever an
expression has the potential to cause Java to throw an exception, you can
embed that expression in a try
catch
statement, in which you specify
explicitly what Java is to do when an exception actually is thrown.