You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm not sure but seems there's an error at page 250: the row and columns are flipped.
Because the first index of a two-dimensional array access the array of array, this index is accessing the rows,
and the second index is accessing column number.
So the statement at the end of the page should be: int[][] myArray = new int[rows][columns],
and even the cycle is flipped, so should be for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
myArray[i][j] = 0;
}
}
am I missing something or It's as like as I'm arguing?
Thanks
The text was updated successfully, but these errors were encountered:
Hi, I'm not sure but seems there's an error at page 250: the row and columns are flipped.
Because the first index of a two-dimensional array access the array of array, this index is accessing the rows,
and the second index is accessing column number.
So the statement at the end of the page should be:
int[][] myArray = new int[rows][columns],
and even the cycle is flipped, so should be
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
myArray[i][j] = 0;
}
}
am I missing something or It's as like as I'm arguing?
Thanks
The text was updated successfully, but these errors were encountered: