Reg for (int index = 3; index-- > 1;)
<p>I have the doubt regarding the for loop execution when i execute the following piece of code </p>

<pre><code>public class LoopTest
{
    public static void main (String... args) {
        int num = 3;
        do {
            for (int index = 3; index-- &gt; 1;)
                System.out.print("index value:" + index + "\n");
            System.out.print("num:" + num + "\n");
        } while (num-- &gt; 1);
        System.out.print("num:" + num + "\n");
    }
}
</code></pre>

<p>OUTPUT:</p>

<pre><code>index value:2
index value:1
num:3
index value:2
index value:1
num:2
index value:2
index value:1
num:1
num:0
</code></pre>

<p>I completely don't understand how the value of index is 2 instead of 3,also 1 get printed inspite of the condition in the for loop "index-- > 1"
Expecting  reply as soon as possible</p>

<p>Thanks in advance,
Nusrath.</p>
