while loops java

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

Source

Also in Java: