两个分号在 Java for 循环中是什么意思?
我正在查看类内部,并遇到了以下方法:AtomicInteger
/**
* Atomically increments by one the current value.
*
* @return the previous value
*/
public final int getAndIncrement() {
for (;;) {
int current = get();
int next = current + 1;
if (compareAndSet(current, next))
return current;
}
}
有人能解释一下是什么意思吗?for(;;)