illustrates an unhandled exception : Exception Try Catch : Language Basics C# Source Code


Custom Search

C# Source Code » Language Basics » Exception Try Catch »

 

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;

  }

}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Language Basics
» Exception Try Catch