Java Reference
In-Depth Information
Tick 4
Tick 3
Tick 2
Tick 1
Do-while statement
This loop executes its body at least once because it contains its condition expression at the
bottom of the loop.
Syntax
do
{
System.out.println (“tick”+ n);
n-- ;
}
While n > 0);
}
}
For statement
It is a very powerful as well as very versatile construct.
The condition what is provided in for statement until and unless the condi-
tion is not been satisfied it won't execute.
If the condition is evaluated and the value is false then it is terminated.
Syntax
For (initialize; condition; iterate)
{
Body
}
For example
Search WWH ::




Custom Search