Why can't a 'continue' statement be inside a 'finally' block?

后端 未结 11 772
情深已故
情深已故 2020-12-23 02:38

I don\'t have a problem; I\'m just curious. Imagine the following scenario:

foreach (var foo in list)
{
    try
    {
         //Some code
    }
    catch (E         


        
11条回答
  •  再見小時候
    2020-12-23 03:04

    You cannot leave the body of a finally block. This includes break, return and in your case continue keywords.

提交回复
热议问题