title: Java 'Write the code necessary to "left rotate" their values:'
body: <p>I've tried a lot of combinations and have searched on the web for something useful but unfortunately I've found nothing useful.</p>
  
  <p>This is for my homework. Only question I cannot answer out of 69 questions.</p>
  
  <p>Question:</p>
  
  <p>Four integer variables, pos1, pos2, pos3, pos4 have been declared and initialized. Write the code necessary to "left rotate" their values: for each variable to get the value of the successive variable, with pos4 getting pos1's value.</p>
  
  <p>Example that I've tried:</p>
  
  <pre><code>int tempP1 = pos1;
  int tempP2 = pos2;
  int tempP3 = pos3;
  int tempP4 = pos4;
  
  pos4 = tempP1;
  pos3 = tempP2;
  pos2 = tempP3;
  pos1 = tempP4;
  </code></pre>
  
  <p>What it shows me:</p>
  
  <pre><code>    Remarks:
       ⇒     Your code had an error during execution
  
  More Hints:
       ⇒     Are you sure you want to use: tempP1
       ⇒     Are you sure you want to use: tempP2
       ⇒     Are you sure you want to use: tempP3
  
  Problems Detected:
       ⇒     pos1 has wrong value
       ⇒     pos3 has wrong value
  </code></pre>