Mega Code Archive

 
Categories / C# / Language Basics
 

Illustrates an unhandled exception

/* Mastering Visual C# .NET by Jason Price, Mike Gunderloy Publisher: Sybex; ISBN: 0782129110 */ /*   Example13_7.cs illustrates an unhandled exception */ using System; public class Example13_7 {   public static void Main()   {     int[] myArray = new int[2];     Console.WriteLine("Attempting to access an invalid array element");     myArray[2] = 1;   } }