Help with 2D array!!!
in
Programming Questions
•
11 months ago
I am trying to get the values into a 2D array but i want it to start storing the value from an index other than 0. Below is the code but gives me "
ArrayIndexOutOfBoundsException: 4" on the highlighted line....I am so tired...Please help me..
Thank you
for (int i = from; i < rows; i++) {
// from is an int value where i want the rows to start from.
// split current line
String[] rows = split(ulinesA[i - from], " ");
// iterate over values
for (int j = 0; j< columns; j++) {
// parse and store the value
valArray[i][j] = float(rows[j]); // where the error is.
}
}
1