previous | start | next

## Parameter Passing

- Java uses "call by value":
  Method receives copy of parameter value
- Copy of object reference lets method modify object

      public void copyNameTo(Greeter other)
      {
       other.name = this.name;
      }

-     Greeter worldGreeter = new Greeter("World");
      Greeter daveGreeter = new Greeter("Dave");
      worldGreeter.copyNameTo(daveGreeter);

previous | start | next