There are four kinds of loops in Java: The while loop The do-while loop The for loop The for-each loop (enhanced for) The while loop It’s executed while the given expression is evaluated to true:
1 2 3 4 |
while (expression) statement_or_block |
If the expression is initially false, the statement or block is never executed. The ..Continue Reading