异常处理关键字

Java的异常处理是通过5个关键字来实现的:try,catch,throw,throws,finally。JB的在线帮助中对这几个关键字是这样解释的:

Throws:Lists the exceptions a method could throw.

Throw:Transfers control of the method to the exception handler.

Try:Opening exception-handling statement.

Catch:Captures the exception.

Finally:Runs its code before terminating the program.

上一篇:通过自定义注解拿到请示路径等参数


下一篇:c++中try catch的用法