Source code for GeorgeWashingtonExample.java:

public class GeorgeWashingtonExample
{
	public static void main(String args[])
	{
		// GeorgeWashingtonExample
		String firstName = "George";
		String lastName = new String("Washington");
		System.out.println(firstName);
		System.out.println(lastName);
		String fullName = firstName + lastName;
		System.out.println(fullName);
		fullName = firstName + " " + lastName;
		System.out.println(fullName);
	}
}

Output from GeorgeWashingtonExample.java:

George Washington GeorgeWashington George Washington

--- Output Ends ---

NOTE:

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