Java provides exception handling mechanism, can be divided into runtimeexception and checked exception two kinds.
RuntimeException
is a run-time exception that the program itself cannot resolve. For example, for a user to register a Web site, if the current user name is already in use, then the solution can only be the current user with the new user name , and the program itself is not resolved (we can not use the program to delete the original user name, not to him, Then register it with the current user ...).
In enterprise development, the exception of general customization (giving feedback to the user) is biased towards the use of runtimeexception, because the caller of the method does not need to be processed (if there is only one to continue throwing), it is best not to handle it. That's what many people say, Do not capture runtimeexception.
Checked Exception
Java.io.UnsupportedEncodingException, for example, is usually caused by improper coding of the program, which is entirely to be solved by the program, and is useless to the user.
Java-An introduction to exceptions