title: Java method doesn't change parameter objects
body: <p>I have a function like this:</p>
  
  <pre><code>public static int partition(List list, ListElement elemL, ListElement elemR){
      ListElement elemX;
      ...
      elemR = elemX.next;
      return x; 
  }
  </code></pre>
  
  <p>And at the end of the funktion the <em>elemR</em> is changed, but after calling the function from the main method the parameter <em>elemR</em> has still the same value like before the function call.
  What's the problem? How can i change this ListElement and "save" this change after the function is called without changing the return type to ListElement (i need the integer return value too)?</p>