-------------------------- Compile Program -------------------------- javac ParameterPassingExample.java -------------------------- Run Program -------------------------- java ParameterPassingExample -------------------------- Program Output -------------------------- +-----------------------------------------------+ | EXAMPLE 1 | +-----------------------------------------------+ In main ======= - The value of b's label is AAA In methodX ========== - The value of y's label is AAA Update the object that both y and b refer to - The value of y's label is BBB Make y reference a different object - doesn't affect variable b - The value of y's label is CCC Updating object that y now references. Has no affect on button referenced by b - The value of y's label is DDD Back in main ============ - The value of b's label is BBB +-----------------------------------------------+ | EXAMPLE 2 | +-----------------------------------------------+ In main ======= - The value of i is 5 In methodZ ========== - The value of j is 5 Change value of j - doesn't affect variable i within main - The value of j is 6 Back in main ============ - The value of i is 5 +-----------------------------------------------+ | EXAMPLE 3 | +-----------------------------------------------+ In main ======= - The value of s is Alex Hunter In methodS ========== - The value of k is Alex Hunter Make k reference a different String object - doesn't affect variable s - The value of k is Alex M. Hunter Back in main ============ - The value of s is Alex Hunter