TIntArrayList list = new TIntArrayList();
final TIntArrayList tempList = new TIntArrayList();
list.add(10086);
list.add(12345);
list.add(1989);
list.forEach(new TIntProcedure() {
@Override
public boolean execute(int i) {
if (i > 10086) {
tempList.add(i);
}
return true;
}
});
I use intellij, and it prompts me to declare tempList by final,why the tempList has to be declared by final?