Java while loops statement allows to repeatedly run the same block of code, until a condition is met.
while loop is most basic loop in Java. It has one control condition, and executes as long the condition is true. The condition of the loop is tested before the body of the loop is executed, hence it is called an entry-controlled loop.
The basic format of while loop statement is:
While (condition)
{
statement(s);
Incrementation;
}
Figure – Flowchart of while loop:
0 Comments
If you have any doubts,please let me know