You Are Here:

Community: Wiki

 

Talk:Exception Handling in Java

From Forum Nokia Wiki

Reviewer Approved   

This article has very big clear explanation on One of the most important concept of java that is Exception Handling. How to write the code to handle it. Most importantly three rules to avoid exception are given like avoid returning values from methods etc.Exceptions are good to handle with care using inbuilt exception classes. Exception handling decreases the chances of breaking application in the middle of the execution.


Step by step instructions with easy going explanation is given with complete code example that are tested well.This articles gives every developers a clear idea on exception handling and the usage of it and with precautions on how to avoid such exceptions.

--Kalki 10:25, 19 September 2009 (UTC)


Review

This is a very well-written discussion on the topic of exception handling in Java. This article would serve as a very useful introduction to anybody new to exception handling in Java. Unlike many other languages, Java “forces” the developer to cater for exceptions in certain circumstances, such as when performing input and output operations.

The author manages to cover several aspects of exception handling in a concise, easy to understand manner. The code examples provided help to clearly illustrate the points made. The article also puts forward three “rules” for handling exceptions, all of which are very valid. Too often, inexperienced programmers will merely “swallow” exceptions. This should almost always be avoided, as an exception indicates that something has gone wrong and code should be written to address the problems which have occurred. Typical examples of code that is needed to handle an exception would be to display an error message or to close a connection.

It was nice to see a nice clear discussion on handling exceptions at different levels and a discussion on when to use the try…catch block and when to use the “throws” syntax. Perhaps one thing that this example lacks is an explanation of the syntax involved. The role of the “finally” block was not explained. In Java this code will always be executed, and is typically used to free up resources and close connections, whether or not an exception has occurred.

--Larry101 13:06, 21 September 2009 (UTC)

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fHttpE3aE2fE2f217E2e218E2e225E2e2E3a2082E2findeE78E2ehtmlE253FX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ