<<< Using Predefined Classes and Methods | Index | The class String >>> |
Like variables declared outside of the method parameter list, a method parameter can be
A primitive data type, or
An object
Passing primitives to a method differs from passing objects:
primitives are passed by copying the value (known as pass by value). The method, therefore, gets a copy of the original variable.
objects are passed by reference -- only memory address is passed -- no copying of the data takes place. The method, therefore, gets access to the original object.
<<< Using Predefined Classes and Methods | Index | The class String >>> |