title: i and i=i++ in for loop java
body: <p>What is the logic behind this behaviour?</p>
  
  <pre><code> int i=0;
      for(int k=0;k&lt;10;k++){
      i++;
      }
      System.out.println("i="+i);
  
  Output=10; //Exepcted
  
  
  
   int i=0;
      for(int k=0;k&lt;10;k++){
      i=i++;
      }
      System.out.println("i="+i);
  
  Output=0; //Surprised :) 
  </code></pre>
  
  <p>Can anybody throw some light on above functionality?</p>