Parameter Passing
The file ChangingPeople.java
contains a program that illustrates parameter passing. The program uses Person
objects defined in the file Person.java. Do the following:
- Trace the execution of the program using diagrams similar
to those in Figure 5.3 of edition 3 of the text (which is a trace of the program
in Listings 5.1 - 5.3) or Figure 6.5 of edition 4+ of the text (which is a
trace of the program in Listings 6.15 - 6.17). Also show what is printed by
the program.
- Compile and run the program to see if your trace was
correct.
- Modify the changePeople method so that it does
what the documentation says it does; that is, the two Person objects passed
in as actual parameters are actually changed.

Go back to lab2 index
page