The list declaration:
private List<SharedData> pairList = new ArrayList<>();
and somewhere in the code I'm trying to run a for loop on this List:
for(pairList.iterator().hasNext()) {
do something;
}
but, I receive an error:
Multiple markers at this line
- Syntax error on tokens, EnhancedForStatementHeaderInit expected
instead
- Syntax error, insert "; ; ) Statement" to complete ForStatement"
That's not so clear for me. Why do I need to add ";;"? I'm also not sure it will run correctly.