Home  |   STIU  |   WOW  |   SCJP  |   SCDJWS   |   JEE FAQ  |   About US  |  

FAQ
  Java FAQ
  JSP FAQ
  Servlet FAQ
 

Advertisement

XyzWs Java FAQ:
How differently does Java handle checked and unchecked exceptions?


Printer-friendly version Printer-friendly version | Send this 
article to a friend Mail this to a friend


Previous Next vertical dots separating previous/next from contents/index/pdf Contents
Advertisement
XyzWs Java FAQ: How differently does Java handle checked and unchecked exceptions?

How differently does Java handle checked and unchecked exceptions?

  • If a method may throw checked exceptions, the calling code must handle the exception by either catching it or by declaring in the signature of the method (as throws). Unchecked exceptions do not have to be handled by the calling code.
  • If a method might throw a checked exception, it must be declared in the signature of the method. Unchecked exceptions do not have to be listed in the method signature.

When to use checked exceptions and unchecked exceptions? Please visit Best Practices for Exception Handling.


Previous Next vertical dots separating previous/next from contents/index/pdf Contents

Support  | Feedback  | Help