January 2018
Intermediate to advanced
115 pages
1h 37m
English
There are four looping structures in Java. They’re used to execute a specific code block multiple times. As with the conditional if statement, the curly brackets for the loops can be left out if there’s only one statement in the code block.
The while loop runs through the code block only if the specified condition is true and will continue looping for as long as the condition remains true. The following loop will print out the numbers 0 to 9:
Note that the condition for the loop must evaluate to a boolean value. This ...