
While Loop Java
While Loop Java
Syntax:
while(condition) { ……; } |
Description :
Entry level loop, executes the statements if condition is true process continues until the condition is failed.
Example:
int i=0; while(i<5) { i++; System.out.println(“Print 5 times”); } |
Output:
Print 5 times
Print 5 times Print 5 times Print 5 times Print 5 times |