首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >为什么这个“最终”会被执行?

为什么这个“最终”会被执行?
EN

Stack Overflow用户
提问于 2009-07-17 05:20:14
回答 5查看 2.2K关注 0票数 18

如果你运行下面的代码,它实际上会在每次调用goto之后执行finally:

代码语言:javascript
复制
    int i = 0;
Found:
    i++;
    try
    {
        throw new Exception();
    }
    catch (Exception)
    {
        goto Found;
    }
    finally
    {
        Console.Write("{0}\t", i);
    }

为什么?

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1141502

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档