[ACCEPTED]-What do two semicolons mean in Java for loop?-for-loop
Accepted answer
It is equivalent to while(true)
.
A for-loop has three 2 elements:
- initializer
- condition (or termination expression)
- increment expression
for(;;)
is not setting any of them, making 1 it an endless loop.
Reference: The for statement
It's the same thing as
while(true) {
//do something
}
...just a little bit 2 less clear.
Notice that the loop will exit 1 if compareAndSet(current, next)
will evaluate as true
.
It's just another variation of an infinite 1 loop, just as while(true){}
is.
That is a for ever loop. it is just a loop 1 with no defined conditions to break out.
It's an infinite loop, like while(true)
.
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.