Using an Invalid Array Index Causes an Exception to Be Thrown

If you try to reference an array element using an index that is outside the declared range of the array, anIndexOutOfRangeException exception will be thrown.
1
2
int[] scores = { 88, 99, 79, 88};
Console.WriteLine("5th element? - {0}", scores[4]);    // IndexOutOfRangeException