Home Segments Top Top Previous Next

185: Mainline

Now, suppose that you hand a class instance to a method as an argument, and then, inside that method, you use the corresponding parameter to reassign an instance variable. Then, because the argument and the parameter share the same chunk of memory for the class instance, and hence for the instance variables, the change survives the method call.