using System;
class MainClass
{
public static void Main()
{
try
{
int [] IntegerArray = new int [5];
IntegerArray[10] = 123;
}
catch(IndexOutOfRangeException)
{
Console.WriteLine("An invalid element index access was attempted.");
}
}
}
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok