title: complete a method that swaps the first and second half of an array of integers
body: <p>I keep getting an out of bounds error whenever i try to run my code. Does anyone know what is wrong with it? I can't seem to figure it out.  </p>
  
  <pre><code>public class Swapper{
  
      /**
      This method swaps the first and second half of the given array.
      @param values an array
       */
  
      public void swapFirstAndSecondHalf(int[] values) {
          // your work here
  
          int[] first = new int[values.length/2];
          int[] second = new int[values.length/2];
          for(int i = 0; i &lt; values.length / 2; i++) {
              second[i] = values[i];
          }
          for (int j = values.length / 2; j &lt; values.length; j++) {
              first[j] = values[j];
          }
          for(int k = 0; k &lt; values.length / 2; k++) {
              values[k] = first[k];
          }
          for(int l = values.length / 2; l &lt; values.length; l++) {
              values[l] = second[l];
          }
      }
  
      // This method is used to check your work
      public int[] check(int[] values) {
          swapFirstAndSecondHalf(values);
          return values;
      }
  }
  </code></pre>