java - Expression expected after this token -
why popping up?
syntax error on token "+", expression expected after token
for (int row = 0; row < data.length; row++) { (int col = 7;;) { data[row][col] = [row][1] + [row][2] + [row][3] + [row][4] + [row][5] + [row][6]; }for (int col = 8;;) { data[row][col] = formatter.format(([row][7] / 2650) * 100); } } it appears on every plus sign , equals after data[row][col] =.
the [row][col] access expression array, need specify array want access on these indices. therefore every of statements indices should start data
for (int row = 0; row < data.length; row++) { (int col = 7;;) { data[row][col] = data[row][7] + data[row][2] + data[row][3] + data[row][4] + data[row][5] + data[row][6]; } (int col = 8;;) { data[row][col] = formatter.format((data[row][7] / 2650) * 100); } } for more information , examples see java tutorial on arrays.
also notice have 2 infinite loops, guess code incomplete or loops redundant
for (int row = 0; row < data.length; row++) { data[row][7] = data[row][1] + data[row][2] + data[row][3] + data[row][4] + data[row][5] + data[row][6]; data[row][8] = formatter.format((data[row][7] / 2650) * 100); }
Comments
Post a Comment