Message d'erreur

mustaph_a Messages postés 20 Date d'inscription mardi 30 août 2005 Statut Membre Dernière intervention 8 mai 2010 - 8 mai 2010 à 11:04
didoux95 Messages postés 845 Date d'inscription mardi 25 avril 2006 Statut Membre Dernière intervention 1 août 2017 - 8 mai 2010 à 14:28
j'ai cette message au cours d'execution : signefie quoi sa????

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 100
at fragmentation.Creerpartition.Lirefragment(Creerpartition.java:92)
at fragmentation.Creerpartition.Lirematrice(Creerpartition.java:62)
at fragmentation.Main.main(Main.java:32)


merci d'avance pour votre aide.

1 réponse

didoux95 Messages postés 845 Date d'inscription mardi 25 avril 2006 Statut Membre Dernière intervention 1 août 2017 2
8 mai 2010 à 14:28
Salut,

Ca signifie simplement que, à un moment de l'exécution de ton programme (en rapport avec un tableau, etc.) tu demandes un élément qui est en dehors.
Par exemple :

public class Test () {
         public static void main (String arg[]) {
try {
                        //Tu remplis ton tableau
int[] tab = new int[10];
for(int a=0; a<tab.length; a++)
tab[a] = a;
                        //Tu affiche le 6eme élément
System.out.println(tab[5]);
                        //Tu affiche le 12eme élément : génère un erreur : tu n'as que 10 éléments !
System.out.println(tab[11]);
}catch (Exception e) {
System.err.println("Erreur ..");
e.printStackTrace();
}

}
}


Voilà ! (:
0
Rejoignez-nous