Existe-t-il un moyen d'imprimer toutes les valeurs d'un tableau 3D?Afficher toutes les valeurs dans un tableau 3D
C'est ce que je suis arrivé, mais obtenir une exception de pointeur NULL:
int i = 2;
int x = 15;
String[][][] arrays = new String[x][x][i];
String arraytext = "hello";
for (String[][] row: arrays)
Arrays.fill(row, arraytext);
for (int a = 0; a<=x; a++){
for (int b = 0; b<=x; b++){
for (int j = 0; j<=i; j++)
{System.out.println(arrays[a][b][j]);}
}
}
Vérifiez la trace de pile. Si vous ne savez pas comment, postez le stacktrace ici. –
le '<=' vous tue. – rpax
où est défini sous? –