Source code for AddIntExample.java:

public class AddIntExample
{
	public static void main(String args[])
	{
		// AddIntExample
		int x = 5;
		System.out.println(x);
		x = 5 + 20;
		System.out.println(x);
	}
}

Output from AddIntExample.java:

5 25

--- Output Ends ---

NOTE:

You are reading previously generated output. You are not currently running the AddIntExample 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