Looping Constructs, while
Syntax:
[initialization]
while ( boolean-expression ) {
[statements]
[iteration]
}
Example:
public static void main(String[] argv) {
int n = 0;
while(n < argv.length) {
System.out.println(argv[n]);
n++;
}
}
Previous slide
Next slide
Back to first slide
View graphic version