While is a type of loop. Statements inside of the loop will continue to repeat while the loop condition is true.
The while loop is primed with a boolean expression/condition. When the condition becomes false, the loop will stop.
while (condition) {
// statements to loop.
}
The example below uses a while loop to increment the value of the int variable num. On each pass of the loop, num has 100 added to it. The loop will continue to execute while the value of num is less than or equal to the value of the int variable maxnum.
The output:
The loop condition can be any expression that return a boolean value.
"Java For Complete Beginners - while loops" ( http://bit.ly/JGnAII )




