- 2
Loops
Can anyone please explain the while loop for me
5 Respuestas
+ 2
Have you got through this? This is part of the tutorial, I don't know what else to explain but what was already explained there.
https://www.sololearn.com/learn/Java/2146/?ref=app
+ 1
Ok, practice sounds like a good idea 👍
+ 1
Andiswa It is a part of Control statements. A while loop allows code to be executed repeatedly until a condition is satisfied. If the number of iterations is not fixed, it is recommended to use a while loop. It is also known as an entry control loop.
while(condition)
{
// Body of while loop
}
Firstly, the condition will be evaluated:
If it returns true, then the body of the while loop will be executed. In the body of while loop the statements contain an update value for the variable being processed for the next iteration.
If it returns false, then the loop terminates which marks the end of its life cycle.
For more details: https://javagoal.com/while-loop-java/
0
I did, i guess need m0re practice on loops
0
Raina Dhankhar thank you I'll follow the link just now