Loops in Java

A loop can be defined as a piece of code that is continually repeated until a specified condition is met.

 

While Loop:

 

A while loop executes a line of code until a specified condition is met. The code will terminate once the desired condition is met, and when no condition is specified a While Loop can run infinitely.

Click here to read more