using System; class Test { static void Main() { while (true) { try { try { Console.WriteLine("Before break"); break; } finally { Console.WriteLine("Innermost finally block"); } } finally { Console.WriteLine("Outermost finally block"); } } Console.WriteLine("After break"); } }the finally blocks associated with two try statements are executed before control is transferred to the target of the jump statement. The output produced is as follows:
Before break Innermost finally block Outermost finally block After breakend example]
| |
Jagger Software Ltd | |
Company # 4070126 | |
VAT # 762 5213 42 |