class run_err { // Quelques exceptions non controlees du Runtime
    public static void main(String args[])   {
       System.out.println("run_err: Verif. de qq exceptions du Runtime (c)~/2A env.");
       System.out.println("-------                             2002.11.04     21H41");
       // ArrayIndexOutOfBoundsException
       char [] tab = {'I','n','f','o','r','m','a','t','i','q','u','e'};
       try  {
         for (int i=0; i<= tab.length; i++)
           System.out.print(tab[i]+" ");
       }
       catch (ArrayIndexOutOfBoundsException excep)  {
           System.err.println("\nErreur : "+ excep);
       }
       // StringIndexOutOfBoundsException
       String palin = "Leon noeL";
       try  {
         System.out.println("\npalindrome : "+ palin.toString() );
         System.out.println(palin.charAt( palin.length() ));
       }
       catch (StringIndexOutOfBoundsException excep)  {
           System.err.println("Erreur : "+ excep);
       }
       // NullPointerException
       String txt = null;
       try  {
         System.out.println("txt : "+txt.toString());
       }
       catch (NullPointerException excep)  {
           System.err.println("Erreur : "+ excep);
       }
       es.attente(); // Pour stabiliser l'écran avant de quitter ...
    }
}

