代码看起来像
public void option() {
seeTasks = tasks.getTasks();
for (int i = 0; i < seeTasks.size(); i++) {
for (int b = 0; b < seeBoxes.size(); b++) {
System.out.println("see Tasks: " + seeTasks.get(i) +
" see Boxes " + seeBoxes.get(b));
if(seeTasks.get(i) == seeBoxes.get(b)) {
option.add(seeTasks.get(i));
}
}
}
System.out.println(option);
}
如果的值 低于 150 ,则if
语句seeTaks.get(i)
不会通过。这怎么可能?seeTasks.get(i)
如下所示,370 不包括在内。如果我将 110 更改为 150,它将无法通过。
println
's 的输出是:
see Tasks: 50 see Boxes 50
see Tasks: 50 see Boxes 110
see Tasks: 50 see Boxes 150
see Tasks: 50 see Boxes 210
see Tasks: 50 see Boxes 270
see Tasks: 50 see Boxes 310
see Tasks: 50 see Boxes 370
see Tasks: 50 see Boxes 430
see Tasks: 110 see Boxes 50
see Tasks: 110 see Boxes 110
see Tasks: 110 see Boxes 150
see Tasks: 110 see Boxes 210
see Tasks: 110 see Boxes 270
see Tasks: 110 see Boxes 310
see Tasks: 110 see Boxes 370
see Tasks: 110 see Boxes 430
see Tasks: 370 see Boxes 50
see Tasks: 370 see Boxes 110
see Tasks: 370 see Boxes 150
see Tasks: 370 see Boxes 210
see Tasks: 370 see Boxes 270
see Tasks: 370 see Boxes 310
see Tasks: 370 see Boxes 370
see Tasks: 370 see Boxes 430
[50, 110]