19.7. Fractals

 
[Page 591 ( continued )]

17.7. Rethrowing Exceptions

Java allows an exception handler to rethrow the exception if the handler cannot process the exception or the handler simply wants to let its caller be notified of the exception. The syntax may look like this:

   try   {   statements; }   catch   (TheException ex) {   perform operations before exits;    throw   ex;  } 

The statement throw ex rethrows the exception so that other handlers get a chance to process the exception ex .

 


Introduction to Java Programming-Comprehensive Version
Introduction to Java Programming-Comprehensive Version (6th Edition)
ISBN: B000ONFLUM
EAN: N/A
Year: 2004
Pages: 503

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net