what is the meaning of following loop? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

what is the meaning of following loop?

for (; ;) { System.out.println("This is printed"); }

4th May 2020, 8:45 AM
Flora Eden
Flora Eden - avatar
3 Answers
+ 5
Infinite loop 1) initialization 2) condition checking 3) increment/decrement are optional in for loop. so if you do not provide the condition checking in the for loop then the condition is always true. for(;;) the for loop will run infinitely. system.out.println(" This is printed"); will get executed repeatedly
4th May 2020, 8:53 AM
Dasarath Singh
+ 2
I get it, thankyou
4th May 2020, 4:15 PM
Flora Eden
Flora Eden - avatar
0
yes it is Infinite loop because the loop has no counter , nor text and nor counter updating
10th May 2020, 10:37 PM
Osama Ghandour Geris
Osama Ghandour Geris - avatar