while (boolean-expression) statement;
class looping { public static void main(String[] args) { int i = 0; while (i < 4) { System.out.printf("i = %d\n",i); i = i + 1; } } }
i
is called the loop control variable.
int i = 0; while (i < 4) { System.out.printf("i = %d\n",i); i = i + 1; }