Mam pytanie. Czy wyjątek-2 z programu poniżej, został utracony i jaka zasada tutaj obowiązuje ?
using System;
namespace ConsoleApp19
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Początek programu");
int[] tablica = new int[10];
try
{
try
{
tablica[10] = 2;
Console.WriteLine("Ta instrukcja się nie wykona");
}
catch (IndexOutOfRangeException e)
{
Console.WriteLine(e.Message);
throw new Exception("Wyjątek-2");
}
finally
{
Console.WriteLine("Ta instrukcja wykona się zawsze!");
throw new Exception("Wyjątek-3");
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
Console.WriteLine("Koniec programu");
}
}
}