March 2004
Intermediate to advanced
560 pages
26h 47m
English
using System;
namespace Samples
{
public class IndexOutOfRangeExceptionSample
{
public static void Main()
{
try
{
string[] strings = {"zero", "one", "two"};
strings[3] = "three";
}
catch(Exception e)
{
Console.WriteLine("Exception: {0}", e);
}
}
}
}
Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array. at Samples.IndexOutOfRangeExceptionSample.Main() in C:\Books\BCL\Samples\ System\IndexOutOfRangeException\IndexOutOfRangeException.cs:line 12
Read now
Unlock full access