Control Flow II: while Loop Constructs
Normal while loop:
while (any Boolean) {
Stuff to do
}
Example:
int i = 0 ;
while(i < a.length) {
a [i] = i * i ;
i++ ;
}
while loop with test at end:
do {
What to do
} while (another Boolean) ;
Previous slide
Next slide
Back to first slide
View graphic version