try/catch里面可以嵌套try/catch么
时间: 2023-08-18 21:05:59 浏览: 276
Try…Catch使用小结
3星 · 编辑精心推荐
回答: 是的,try/catch里面可以嵌套try/catch。当内层的try/catch捕获异常后,会先执行内层的catch块,然后执行内层的finally块,接着执行外层的finally块。如果内层的catch块没有被执行到,只执行了内层的finally块,那么外层的catch块会捕获到该异常并执行。 [3<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [try catch里面try catch嵌套](https://blog.csdn.net/wojiuguowei/article/details/119251951)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文