Java - for loop optional control

Introduction

All three parts (initialization, condition-expression, and expression-list) in a for-loop statement are optional.

The statement, which is the body of for loop, is not optional.

An infinite loop using a for-loop statement can be written as follows:

for( ; ; ) { 
}

Or

for( ; ; ); 

Related Topic