doubt in for loop
<p>i have the following code</p>

<pre><code>public static void main(String[] args) {
  int x=0;
  int y=0;
  for(int z=0;z&lt;5;z++)
    if((++x&gt;2)||(++y&gt;2))
      x++;

  System.out.println(x+" "+y);

}
</code></pre>

<p>For this the output is 8 2</p>

<pre><code>public static void main(String[] args) {
  // TODO Auto-generated method stub
  int x=0;
  int y=0;
  for(int z=0;z&lt;5;z++){
    if((++x&gt;2)||(++y&gt;2))
      x++;

    System.out.println(x+" "+y);
  } 
}
</code></pre>

<p>i can understand the second code that it prints everytime till the loop completes.
For the first code 
when x becomes 3 in the if loop value will be incremented to 4 and after that what well happen will it go to sop or to for loop to complete the loop?</p>
