Through their own understanding of the study, there will certainly be mistakes, I hope that we help correct, utilitarian and violent wording ...
Try
Where if is to determine if you have defined the exception, throw is to throw the exception, below you see my definition of the exception class, Notfoundname accept the string, usually I write the name of the exception
This is the exception class that I define, except that the constructor is basically auto-generated. Catch is the exception and deal with it.
Guys[0].addmane I wrote above, I called the method of adding a name to handle the exception, while some people will write finally
The purpose of the finally statement is to be afraid of modifying the mutable variable in the exception's throw, so use finally to change the content back
When a catch statement does not exist, the finally statement must be present and immediately after the try statement.
? No statements can exist between the try statement and the catch statement, nor can any statements be present in the catch and finally statements, where the statement does not include the comment statement.
? When a catch statement does not exist, the finally statement must be present and immediately after the try statement. No statements can exist between a try statement and a catch statement.
Exceptions and logs thrown in Java (1)