如果发生错误,请填写缺少的部分以输出错误消息。
@(3)
{
int[] myNumbers = {1, 2, 3};
Console.WriteLine(myNumbers[10]);
}
@(5) (Exception e)
{
Console.WriteLine(e.Message);
}
try
{
int[] myNumbers = {1, 2, 3};
Console.WriteLine(myNumbers[10]);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}