catch之后的代码什么时候执行

1.若catch(){}块中,如果有throw 语句,则,try{}catch(){} finally{}块之外的代码不执行;

  否则,执行。

2.try{}中有异常,则异常下面代码不执行。

3.finally{}中代码必执行。

 

 catch可以省略,try的形式有三种:

try-catch

try-finally

try-catch-finally
catch和finally语句不能同时省略!
posted @ 2020-07-06 20:24  ASini  阅读(1673)  评论(1编辑  收藏  举报