Java.lang.ArrayIndexOutOfBoundsException:

Résolu
domxaline -  
 domxaline -
Bonjour,
mon prg me donne un résultat comme qui suit:
tab 0=[I@7122e0b3tab0=[I@7122e0b3
tab 0=[I@7122e0b3tab1=[I@28ce41cc
tab 0=[I@7122e0b3tab2=[I@7d41cd01
tab 0=[I@7122e0b3tab3=[I@6afa3ce5
tab 0=[I@7122e0b3tab4=[I@52b41541

quelqu'un peut m'aider svp

public class Divers3
{
public static void main(String[] args)
{
int i,j=0;
int tab[][]=new int[5][12];
for(i=0;i<5;i++)
{
for(j=0;j<12;j++)
{
tab[i][j]=0;
System.out.println("tab "+i+"="+tab[i]+"tab"+j+"="+tab[j]);
}
}
}
}



2 réponses

KX Messages postés 16761 Date d'inscription   Statut Modérateur Dernière intervention   3 020
 
Bonjour,

Ce n'est pas tab[j] mais tab[i][j] sinon ça n'aurait pas d'intérêt d'avoir tab[][]
1
domxaline
 
ok merci beaucoup j'ai compris
0