Why is the output for this code in this way?
<pre><code>class MainDemo{ 

     public static void main(String args[]){ 
        float arrayOne[] = {1, 2, 3, 4,5}; 
        for(int iIndex=0; iIndex&lt;arrayOne.length; iIndex++) 
        { 
               arrayOne[iIndex] = iIndex; 
               iIndex=iIndex+1; 
         } 
         for(int iIndex=0; iIndex&lt;arrayOne.length; iIndex++) 
         { 
               System.out.println(arrayOne[iIndex]); 
         } 
 } 
}
</code></pre>

<p><br>
Why is the output?</p>

<pre><code>0.0
2.0
2.0
4.0
4.0
</code></pre>

<p>instead of </p>

<pre><code>0.0
1.0
2.0
3.0
4.0
</code></pre>
