Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a "for(;;)" loop used for? [duplicate]

Possible Duplicate:
Infinite loop application - for(;;)

I am a Java developer, and I saw this in one of the classes:

for(;;){
something goes here
}

What does this loop mean? When would we have to use it?

Thanks

like image 897
developer Avatar asked Nov 30 '22 13:11

developer


1 Answers

It's an infinite loop, an equivalent of this could be

while(true) which is definitely used a lot more than an infinite for loop.

But they both mean the same thing in this situation.

like image 86
Austin Avatar answered Dec 04 '22 03:12

Austin