

The while statement is another looping statement of Java with an entry control option for execution.
It acts as one of the simplest looping structures of Java and has the following format.
Initialization;
while (test expression)
{
body of the loop
}
where the test expression is the conditional state which executes the
body of the loop if it returns the true value and terminates once the
value returned for the test condition is false. It acts as an entry
controlled loop and the given test expression is evaluated at every
execution of the body of the loop.