Java Do While Loop

When we wish to test the exit condition at the end of the loop, we use a do-while loop. The do-while loop always executes its body at least once, because its conditional expression is at the bottom of the loop.

Example:

Output

Leave a Comment