title: 2D array and creating a mirror of an image
body: <p>I'm supposed to create an image editor using 2D arrays.  For this part I'm supposed to create code that creates a mirror of the image by flipping it left to right. Instead I'm flipping it upside down. What am I doing wrong?</p>
  
  <pre><code>public void mirror() {
      // TODO Auto-generated method stub
      int[] img;
      int left = 0, right = data.length -1;
      while (right &gt;= left) {
          img = data[left];
          data[left++] = data[right];
          data[right--] = img;
      }       
  }
  </code></pre>