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

  否则,执行。

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

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

 

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

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

try-catch

try-finally

try-catch-finally
catch和finally语句不能同时省略!

相关文章:

  • 2022-12-23
  • 2021-11-20
  • 2021-10-22
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2021-10-27
猜你喜欢
  • 2022-12-23
  • 2021-10-27
  • 2021-09-02
  • 2021-09-20
  • 2021-04-24
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案