C# Time of finally execution

后端 未结 9 1702
情话喂你
情话喂你 2021-02-04 01:37

Take this code:

using System;

namespace OddThrow
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
              


        
9条回答
  •  半阙折子戏
    2021-02-04 02:26

    I could be way off base in the way I'm reading things...but you have a try finally block without a catch.

    Juding by the description you posted, since the Exception is never caught, it bubbles up to the caller, works it's way up through the stack, is eventually unhandled, the call terminates, and then the finally block is called.

提交回复
热议问题