using System;
class MainClass
{
publicstaticvoid Main()
{
try
{
int [] IntegerArray = newint [5];
IntegerArray[10] = 123;
// wait for user to acknowledge the results
Console.WriteLine("Hit Enter to terminate...");
Console.Read();
}
catch(IndexOutOfRangeException)
{
Console.WriteLine("An invalid element index access was attempted.");
}
}
}