FileDocCategorySizeDatePackage
LoopWhile.javaAPI DocExample352Sat Oct 26 09:53:50 BST 2002None

LoopWhile.java

/** Compile this program and dump the compiled bytecode
 * with "javap -c" or equivalent; you will be enlightened
 * as to the true nature of while loops compared to for loops.
  */
class Loops {	// EXPECT WARNING ABOUT NAME

	 public static void main(String[] args) {
	 		int i = 0;
	 		while (i<10) {
	 			System.out.println(i);
	 			i++;
	 		}
	}
}