|
Java Arrays, Objects, Methods
|
CS 161 - Java |
Perform group of statements for a number of times
for (initialization ; expression that evaluates to boolean ; increment) {
// Code that executes each time through the loop ...
}
Perform group of statements while a condition is statisfied
while (expression that evaluates to boolean ) {
// Code that executes each time through the loop ...
}
Perform group of statements while a condition is statisfied
do {
// Code that executes each time through the loop ...
} while (expression that evaluates to boolean );
Question: How is while different from do ... while