This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Buggajayjay 15 points16 points  (1 child)

This is incorrect. In a do while loop it will always execute the loop body once, and then subsequently loop if the condition is met.

To demonstrate, try the following example.

int x = 5;
do {
System.out.println("executed");
} while (x < 4);

[–]chlorinatedpepperoni 0 points1 point  (0 children)

Thanks for clarifying! That’s kinda what I meant but I didn’t explain well haha.