Gestion d’exception ‘IndexOutOfRangeException’

Author:

ArrayList, Array, HashTable, BitArray
{filelink=18434}

using System;

class ExException
{
    public static void Main()
    {
        try
        {
            int [] tableauTest = new int [10];
            tableauTest[10] = 123; // Exception
        }
        catch(IndexOutOfRangeException err)
        {
            Console.WriteLine("Erreur: "+err);
        }
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *