コードは次のようになります
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
というステートメントは実行され ます。これはどのようになりますか?以下に示すように、370は含まれていません。110から150に変更しても通過しません。seeTaks.get(i)
seeTasks.get(i)
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]