The Future Is Behind You

While Loop

Unlike a do while loop, the code won't get executed unless the condition is initially met.

public class While {

  public static void main(String[] args) {

    int i = 0;

    while(i < 10) {
      System.out.println(i);
      i++;
    }
  }
}

Output:

0
1
2
3
4
5
6
7
8
9

a = b = c