References

The file Person.java defines a simple class that represents a person (a Person has a name and an age). The file References1.java contains a program that instantiates three Person objects and then makes some modifications to the objects and their references.

The output of the corrected program should look like this:

The three original people...
Rachel - Age 6, Elly - Age 4, Sarah - Age 19

The three people reassigned...
Elly - Age 4, Sarah - Age 19, Rachel - Age 6

Changing the second name to Bozo...
Elly - Age 4, Bozo - Age 19, Rachel - Age 6

Changing the third name to Clarabelle...
Elly - Age 4, Bozo - Age 19, Clarabelle - Age 6

Changing the first name to Harpo...
Harpo - Age 4, Bozo - Age 19, Clarabelle - Age 6

The file References2.java contains another program involving Person objects. This one illustrates the difference between assignments involving objects and assignments involving primitive values.