title: Shifting elements in array
body: <p>I am trying to shift elements in an array. I tried from the book but it does not seem to work.
  The user types in how many to shift the array by in the main class, and then it gets sent into a shifter class into a shift method. Starting from array position [1].</p>
  
  <p>This is what I have:</p>
  
  <pre><code>// Pos is the users entered for how many positions to shift
  // data is the array of elements 1-length of data
  // temp is place holder
  
  public void shift(int pos)
  {
      while(pos &gt; 0)
      {
          int temp = data[data.length];
  
          for(int i = pos; i == data.length; i++ )
          {
              data[i+1] = data[i];
          }
          data[data.length] = temp;
          pos--;
      }   
  }
  </code></pre>