Difference between revisions of "Exceptions"

From Suhrid.net Wiki
Jump to navigationJump to search
Line 1: Line 1:
 
 
* Exceptions are a mechanism to detect and handle errors without writing special code to test return values.
 
* Exceptions are a mechanism to detect and handle errors without writing special code to test return values.
 +
* Error handling code for common errors can be handled in a single place.
 +
* A try clause has to have either a catch clause or a finally clause or both.
 +
* catch must follow try.
 +
* finally must follow the last catch clause.
  
 
[[Category:OCPJP]]
 
[[Category:OCPJP]]

Revision as of 22:39, 19 July 2011

  • Exceptions are a mechanism to detect and handle errors without writing special code to test return values.
  • Error handling code for common errors can be handled in a single place.
  • A try clause has to have either a catch clause or a finally clause or both.
  • catch must follow try.
  • finally must follow the last catch clause.