在catch块之后继续执行程序(循环). [英] Continuation of the program (loop for) after the catch block.

查看:121
本文介绍了在catch块之后继续执行程序(循环).的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

try and catch块正在循环中.
假设是当i = 2源代码传输到catch时.在catch块应从i = 3循环以继续之前

A try and catch block is in the loop for.
The assumption is when i = 2 source code is transferred to the catch. After the catch block should loop from i = 3 to continue

推荐答案

i = 2出现异常后,以下内容确实会继续到3和4:

The following does continue to 3 and 4 after an exception when i = 2:

for (int i = 1; i < 4; i++)
{
    try
    {
        int s = 1 /(i - 2);
    }
    catch
    {
    }
}


这篇关于在catch块之后继续执行程序(循环).的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆