For Loop

For Loop

For Loop — used when the number of iterations is known beforehand.

for (initialization; condition; update) {
    // Loop body
}
For (int i = 1; i <= 5; i++) {
    System.out.println("Iteration: " + i);
}

It contains an initialization, condition, and an update step.

Related concepts

For Loop

For Loop — Structure map

Clickable & Draggable!

For Loop — Related pages: