title: Java i++ operation explanation
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5098282/what-is-the-difference-between-a-b-and-a-b-also-a-and-a">What is the difference between a += b and a =+ b , also a++ and ++a?</a><br>
    <a href="https://stackoverflow.com/questions/7911776/what-is-x-after-x-x">What is x after &ldquo;x = x++&rdquo;?</a>  </p>
  </blockquote>
  
  
  
  <p>In Test1 i increments its value by 1 and return old value and keep its incremental value in i variable. But in Test2 i increments its value by 1 and return its old value and the increment also occurred. Are they make a copy of i for the increment which is not assigning in the i variable.  What is the operational step in Test2.  </p>
  
  <p><strong>Test1</strong></p>
  
  <pre><code>int i = 0;
  System.out.print(i++);
  System.out.print(i);
  </code></pre>
  
  <p>Output 01</p>
  
  <p><strong>Test2</strong></p>
  
  <pre><code>int i = 0;
  i = i++;
  System.out.println(i);
  </code></pre>
  
  <p>Output 0</p>