Java Reference
In-Depth Information
The output from this program is shown here:
As you can see, the operations that occur inside noChange( ) have no effect on the values
of a and b used in the call.
When you pass an object to a method, the situation changes dramatically, because objects
are implicitly passed by reference. Keep in mind that when you create a variable of a class
type, you are creating a reference to an object. It is the reference, not the object itself, that
Search WWH ::




Custom Search