When used to best advantage, exceptions can improve a program's readability, reliability and maintainability. When used improperly, they can have the opposite effect. Playing basketball, too, pretty fake indeed be awesome for me, but with unreasonable then It can only be said that it is a fancy and is not practical.
Exception can be divided into three categories, Checked Exceptions, Runtime Exceptions, and Errors. For example, there may be Exceptions such as hand when the cap is capable, but this will not lead to this failure to make this. You can go to Go ON by free throw. Only your cap is invalid for a foul, that is, you can't get the result of your cap number. Such exception is called Checked Exception. Sometimes the game may be with a player than the reality is a bad thing, but causing the audience to make a lot of people (dizzy), such as to the scene, causing the competition. Can you go on. You cannot be sure. This creates a Runtime Exception. There are still some situations, such as the game, the electronic scoreboard suddenly produces an Exception.74 points to 47 points, then you have to sigh helplessness, because this is an error. Thus It seems that Checked Excetion is recoverable, you should use Checked Exceptions under recovery, and then two exceptions needn't and usually stayn't be caught. Where Runtime Exceptions appear means that your program itself has problems, you You can solve it by improving the tactics of the team. Errors is a problem with james gosling, it is not your business.
Exceptions is useful, but many cases of Exceptions are Unnecessary. For example, the following program: while (no defense) {Try {shooting ();} catch (too far exception e) {system.out.println ("distance is far from 10 meters, I don't want to stick");} ...} This program can run normally, but if Kobe is moving in the back of the back, it has to throw the "distance too far exception", which is really difficult for him. Changed: while (no defensive) {IF (distance <5) {shooting ();} ...} This time I will look at the eye, and I will jump too much.
In addition, after one method generates Exception, the status of calling the method object should not be changed. The process made this problem: public void cap () {cap number ; if (hand) throw new hand exception ();} This game, a three pairs of games are much easier, huh, huh. Change to: Public Void Cap () {IF (Hand) throw new hand exception (); cap number ;} is OK. This problem seems to EASY, but it is also the most likely to make mistakes.