Section: For loop

Basic for loop

java
java
for (int i = 0; i < 5; i++) {\n  System.out.println(i);\n}
Explanation

Classic counted loop. Great when you need an index.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing For loop
Loop N times
OpenIn sheetjavasame section
Reverse loop
OpenIn sheetjavasame section
Enhanced for (for-each)
Iterate values without index
OpenIn sheetjava2 tag match
while loop
OpenIn sheetjava2 tag match
do-while loop
Executes body at least once
OpenIn sheetjava2 tag match