in java, and some other programming languages every itererative structure for can be written in equivalent while structure in the following way
syntax of for
for(expression1:expression2;expression3)
statament
the equivalent while structure looks like
expresion1;
while (expression2)
{
statement;
expression3;
}