The
do Statement
do
and
while
are
reserved
words
do{
statement;
}
while (condition);
The
statement is executed once initially,
and
then the condition is evaluated
The
statement is executed repeatedly
until
the condition becomes false
do-while
Example
final
int LIMIT = 5;
int
count = 1;
do {
System.out.println(count);
count += 1;
}
while (count <= LIMIT);
No comments:
Post a Comment