do-while Loop

The Java do-while loop is executed at least once because condition is checked after loop body.

It causes the loop to immediately jump to the next iteration of the loop.

Example: This program will print numbers from 1 to 10.

public class DOWhileLoop_Example1 {
	public static void main(String[] args) {
		int i = 1;
		do {
			System.out.println(i);
			i++;
		} while (i <= 10);
	}
}