Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 594 Bytes

while.md

File metadata and controls

33 lines (24 loc) · 594 Bytes
layout title parent nav_order
default
while Loop
Iterative Statements
2

While Loop

The Java while loop is used to iterate a part of the program several times. If the number of iteration is not fixed, it is recommended to use while loop.

Syntax:

    while(condition){  
    //code to be executed  
    }  

while loop syntax


Java Infinitive While Loop

If you pass true in the while loop, it will be infinitive while loop.

Syntax:

    while(true){  
    //code to be executed  
    }