Do...while loop

Do...while loop

Do...while loop — is similar to the while loop, but with a key difference: it guarantees that the loop body executes at least once, even if the condition is false.

do {
    // Loop body
} while (condition);
int count = 1;

do {
    System.out.println("Count: " + count);
    count++;
} while (count <= 3);

Related concepts

Do...while loop — Structure map

Clickable & Draggable!

Do...while loop — Related pages: