Java is Pass-by-Value, Dammit
So to summarize, you have a Java function:<p><pre><code>  public void f(Foo bar) { ... }
</code></pre>
Which is the equivalent C++ function?<p><pre><code>  void f(Foo bar) { ... }
  void f(Foo& bar) { ... }
  void f(Foo* bar) { ... }
</code></pre>
It's the last one. Java passes everything by value, but non-primitive objects in Java are actually pointers (which Java inaccurately calls references), and the <i>pointer</i> is passed by value.