title: Passing a String by Reference in Java?
body: <p>I am used to doing the following in <code>C</code>:</p>
  
  <pre><code>void main() {
      String zText = "";
      fillString(zText);
      printf(zText);
  }
  
  void fillString(String zText) {
      zText += "foo";
  }
  </code></pre>
  
  <p>And the output is:</p>
  
  <pre><code>foo
  </code></pre>
  
  <p>However, in Java, this does not seem to work. I assume because the <code>String</code> object is <em>copied</em> instead of <em>passed by referenced</em>. I thought Strings were objects, which are always passed by reference. </p>
  
  <p>What is going on here?</p>