+ 2

What does an empty for-loop (for(;;)) in Java do?

What happens if dont type any conditions in a for-loop in Java, but only two semicolons? Is this an infinite loop? And is this useful in any situation?

14th Mar 2018, 8:14 AM
Bram
2 Answers
+ 9
yes this is a infinite loop i made this it might be useful â˜ș https://code.sololearn.com/c4AI99y8ocS5/?ref=app
14th Mar 2018, 8:32 AM
D_Stark
D_Stark - avatar
+ 16
for(;;) is also a infinite loop in C++ 👍😉
14th Mar 2018, 8:38 AM
tooselfish
tooselfish - avatar