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;
}
});
我用intellij,它提示我用final声明tempList,为什么tempList必须用final声明?