Java – do loop
The difference between do-while and while is that do-while evaluates its expression at the bottom of the loop instead of the top. Therefore, the statements within the do block are always executed at least once.
int num = 0;
do {
System.out.println("Line " + (num++));
} while (num < 5);
The loop will continue to increment by one on every loop untill it reaches 5.
