Java exception handling best practices — reprint

Original address: http://howtodoinjava.com/2013/04/04/java-exception-handling-best-practices/

This post is another addition in series available in this blog. In this post,I am covering some well-known and some little known practices which you must consider while handling exceptions in your next java programming assignment. Follow this link to read more about in java.

Checked exceptions are exceptions that must be declared in the throws clause of a method. They extend Exception and are intended to be an “in your face” type of exceptions. Java wants you to handle them because they somehow are dependent on external factors outside your program. A checked exception indicates an expected problem that can occur during normal system operation. Mostly these exception happen when you try to use external systems over network or in file system. Mostly,the correct response to a checked exception should be to try again later,or to prompt the user to modify his input.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>