Difference in the output in Java
<p>I have one program in java..i am confused about the output.</p>

<pre><code>public static void main(String args[])
{
        int n=0;
        for(int m=0; m&lt;5;m++)
        {
            n=n++;
            System.out.println(n);
        }
}
</code></pre>

<p>here output is 0 0 0 0 0</p>

<p>But if i write,</p>

<pre><code>public static void main(String args[])
{
        int n=0;
        for(int m=0; m&lt;5;m++)
        {
            n++;
            System.out.println(n);
        }
}
</code></pre>

<p>then output is 1 2 3 4 5</p>

<p>Why it is coming like this???</p>
