title: How do I reverse an int array in Java?
body: <p>I am trying to reverse an int array in Java.</p>
  
  <p>This method does not reverse the array.  </p>
  
  <pre><code>for(int i = 0; i &lt; validData.length; i++)
  {
      int temp = validData[i];
      validData[i] = validData[validData.length - i - 1];
      validData[validData.length - i - 1] = temp;
  }
  </code></pre>
  
  <p>What is wrong with it?</p>