Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException:2
public class ArrayParse {
public static void main(String[] args) {
double[][] d;
String s = "1,2;3,4,5;6,7,8;";
String[] sFirst = s.split(";");
d = new double[sFirst.length][];
for(int i=0; i<sFirst.length; i++) {
String[] sSecend = sFirst[i].split(",");
d[i] = new double[sSecend.length];
for(int j=0; i<sSecend.length; j++) {
d[i][j] = Double.parseDouble(sSecend[j]);
}
}
for(int i=0; i<d.length; i++) {
for(int j=0; j<d[i].length; j++) {
System.out.print(d[i][j]);
}
System.out.println();
}
}
}