View RSS Feed

Java Exception

Exception handling best practices

Rate this Entry
by , 01-08-2012 at 11:58 AM (1890 Views)
Following are the best practices when catching and handling exceptions in your java code.

• Do not catch “Exception” directly in your code. Java exception handling is not polymorphic. If you catch Exception, it can catch IOException or any other descendent type.

Name:  62.JPG
Views: 974
Size:  35.3 KB

Catching Exceptions

• Exception handling supports the stack trace of any error in your code. Always throw an exception early in your code to make this trace more accurate.
• Always catch a checked exception late in your code.

Submit "Exception handling best practices" to Facebook Submit "Exception handling best practices" to Digg Submit "Exception handling best practices" to del.icio.us Submit "Exception handling best practices" to StumbleUpon Submit "Exception handling best practices" to Google

Comments