Shift operator in Java bizarre program output
<p>I came across the following program and it behaving in unexpected manner.</p>

<pre><code>public class ShiftProgram
{
      public static void main(String[] args)
      {
             int i = 0;
             while(-1 &lt;&lt; i != 0)
                   i++;
             System.out.println(i);
      }
}
</code></pre>

<p>If we think about this program output, when it reaches 32 while loop condition should return false and terminate and it should print 32.</p>

<p>If you ran this program, it does not print anything but goes into an infinite loop. Any idea whats going on? Thank you in advance. </p>
