When trying to compile a class, I am getting the following error;
ExcelReportServlet.java:341: error: not a statement
/* 302 */ for (Iterator localIterator = keyset.iterator();localIterator.hasNext(); i < j)
^
1 error
The particular code is as follows;
int j;
int i;
for (Iterator localIterator = keyset.iterator(); localIterator.hasNext(); i < j)
What am I doing wrong? Please help...
If (i<j) is a condition that controls the termination of the for loop, it should be in the second part of the for statement.
For example (not sure if that's the required logic) :
for (Iterator localIterator = keyset.iterator(); localIterator.hasNext() && i < j;)
i < j is not a StatementExpression. And according to JLS(§14.14), the rightmost part of for loop is defined as ForUpdate which is in return a StatementExpressionList (a list of StatementExpression).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With