Source code for LessThanExample.java:

public class LessThanExample
{
	public static void main(String args[])
	{
		// LessThanExample
		int x = 0;
		while (x < 5)
		{
			System.out.println(x);
			x = x + 1;
		}
	}
}

Output from LessThanExample.java:

0 1 2 3 4

--- Output Ends ---

NOTE:

You are reading previously generated output. You are not currently running the LessThanExample application at the momement. You need to compile and run the source code first.

To run this program:


Authors: Kevin Chu and Eric Brower
Copyright 2000 Prentice Hall PTR