try/catch/finnaly


If control leaves the try block because of a return , continue , or
break statement, the finally block is executed before control transfers to its new destination.

If a finally block itself transfers control with a return , continue , break , or throw statement, or by
calling a method that throws an exception, the pending control transfer is abandoned, and this new
transfer is processed. For example, if a finally clause throws an exception, that exception replaces any
exception that was in the process of being thrown. If a finally clause issues a return statement, the
method returns normally, even if an exception has been thrown and has not yet been handled.

你可能感兴趣的:(catch)