for (int i = 0; i < 3; ++i){}
时间: 2024-05-24 15:10:31 浏览: 138
java基础知识点研究.txt
This for loop is missing the third expression that specifies the increment/decrement of the loop variable. It should be:
for (int i = 0; i < 3; i++) {}
This loop will execute the code block inside the curly braces 3 times, with the loop variable i starting from 0 and incrementing by 1 each time until it reaches 2 (because the condition i < 3 will no longer be true when i is 3).
阅读全文