while loop java

Java
int i = 0;
while (i < 5) {
  System.out.println(i);
  i++;
}
package com.journaldev.javadowhileloop;

public class JavaDoWhileLoop {

	public static void main(String[] args) {

		int i = 5;
		do {
			System.out.println(i);
			i++;
		} while (i <= 10);
	}
}
while(i < 5) //while i < 5 stay in the loop
{
  System.out.print(i);
  i++;
}
/*
	do someting
	change variable
    call methods
    etc...
*///runs as long as the condition is true
while(condition){
//do what you want in here
doStuff()
}int i = 0;
while (i < 5) {
  System.out.println(i);
  i++;
}
Source

Also in Java: