The while Statement

The while Statement

class {
    public static void main(String[] args){
        int count = 1;
        while (count < 11) {
            System.out.println("Count is: " + count);
            count++;
        }
    }
}

Continually executes a block of statements while a particular condition is true.

The while statement evaluates expression, which must return a boolean value. If the expression evaluates to true, the while statement executes the statement(s) in the while block. The while statement continues testing the expression and executing its block until the expression evaluates to false.

The while Statement — Structure map

Clickable & Draggable!

The while Statement — Related pages: