In: Computer Science
In java, I keep getting the error below and I can't figure out what i'm doing wrong. Any help would be appreciated.
207: error: not a statement
allocationMatrix[i][j];
In Java, every statement has a lValue and rValue. The lValue is mostly the variable, whose value can be changed and rValue can be another variable or constant. However in case of method calls, You are not required always to have a lValue. Hence, When you say allocationMatrix[i][j]; This means You are reading the value from a 2-D matrix, and then you are trying to keep the value in some variable.. So, Instead of allocationMatrix[i][j];, you should say: int value = allocationMatrix[i][j]; In any case, If you still face issues, Please share your entire code, so that i can check it properly and tell you what piece is causing the issue.
************************************************** Thanks for your question. We try our best to help you with detailed answers, But in any case, if you need any modification or have a query/issue with respect to above answer, Please ask that in the comment section. We will surely try to address your query ASAP and resolve the issue.
Please consider providing a thumbs up to this question if it helps you. by Doing that, You will help other students, who are facing similar issue.