According to Java Language Specification, section 14.14.1.2:
for ( ForInit
opt; Expression
opt; ForUpdate
opt) Statement
If the
Expression
is not present, or it is present and the value resulting from its evaluation (including any possible unboxing) istrue
, then the containedStatement
is executed.
Since the standard treats missing expressions and expressions evaluating to true
in the same way, the for
loop with the missing expression is equivalent to an infinite loop.