All parameters are passed by value in
Java. When a reference type is passed as a parameter, a copy of the reference is passed. Modifying the copy of the reference has the same effect as modifying a copy of a primitive type: none. However, the copy of the reference may be used to call methods or access public fields (if any) of the object represented by the reference, thereby changin its state.
Consider the following example, adapted from the RHE book (see the Bunkhouse), 2nd ed.
Running the program produces the output "Pink." However, if you replace the body of changeLabel() with
the program produces the output "Blue."
Hope this helps.
Craig