title: How does java.util.Collections.reverse() work?
body: <p>See the documentation of <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collections.html#reverse%28java.util.List%29" rel="nofollow">java.util.Collections.reverse()</a>.</p>
  
  <p>I don't understand how Java methods can only pass by value, but yet the following is allowed:</p>
  
  <pre><code>public static void reverse(List&lt;?&gt; list)
  </code></pre>
  
  <p>How can it change the original object passed through the parameter? Especially when all objects passed through parameters are passed by value? Shouldn't that mean that only a copy of the object is passed through, and therefore only a reference could be returned? Since we're returning void, how can we change the original object being passed through?</p>
  
  <ul>
  <li>A very confused Java Padawan</li>
  </ul>