0
String[][] work = new String[3][];
work[0] = new String[3];
work[0][0]=" !!! ";
work[0][1]=" !!! ";
work[0][2]=" !!! ";
work[1] = new String[3];
work[1][0]=" !!! ";
work[1][1]=" !!! ";
work[1][2]=" !!! ";
work[2] = new String[3];
work[2][0]=" !!! ";
work[2][1]=" !!! ";
work[2][2]=" !!! ";
多數民衆贊成在不工作對我來說,我不知道哪裏是在線程 「AWT-EventQueue的 - 0」 java.lang.ArrayIndexOutOfBoundsException錯誤 例外: 3
for(int i=0;i<13;i++){
work[i]= new String[3];
}
for(int i=0;i<13;i++){
for(int j=0;j<3;j++){
work[i][j]=" !!! ";
}
}
for(String[] x: work){
for(String e : x){
System.out.println(e);
}System.out.println();
}
錯誤是這裏 字符串[] [] =工作新的String [13] []; 3-> 13