title: java Bit operations >>> shift
body: <p>Why if </p>
  
  <pre><code>int x = -1 // binary: 11111111111111111111111111111111
  x = x &gt;&gt;&gt; 31; 
  </code></pre>
  
  <p>we have 00000000000000000000000000000001</p>
  
  <p>but if </p>
  
  <pre><code>int x = -1
  x = x &gt;&gt;&gt; 32;
  </code></pre>
  
  <p>we have 11111111111111111111111111111111  (again -1)</p>
  
  <p>but not 00000000000000000000000000000000 ?</p>