title: How does a=a++ work in java
body: <p>Recently I came across this piece of Java code:</p>
  
  <pre><code>int a=0;
  for(int i=0;i&lt;100;i++)
  {
      a=a++;
  }
  System.out.println(a);
  </code></pre>
  
  <p>The value printed for 'a' is 0. However in case of C, the value for 'a' comes out to be 100.</p>
  
  <p>I am not able to understand why the value is 0 in case of Java.</p>