The while statement evaluates an 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.
while (expression) { statement(s) }
What will be the output of the program below? Copy into BlueJ and run.
/** * A simple "while loop" example. */ class WhileDemo { public static void main(String[] args){ int count = 1; while (count < 11) { System.out.println("Count is: " + count); count++; } } }