title: Java shift operator don't works the same with a pre saved value than with the direct value
body: <p>This comes up after solve the problem:</p>
  
  <p><a href="https://www.hackerrank.com/challenges/flipping-bits/problem?h_l=interview&amp;playlist_slugs%5B%5D%5B%5D=interview-preparation-kit&amp;playlist_slugs%5B%5D%5B%5D=miscellaneous" rel="nofollow noreferrer">https://www.hackerrank.com/challenges/flipping-bits/problem?h_l=interview&amp;playlist_slugs%5B%5D%5B%5D=interview-preparation-kit&amp;playlist_slugs%5B%5D%5B%5D=miscellaneous</a></p>
  
  <p>My solution is:</p>
  
  <pre><code>static long flippingBits(long n) {
      long l=0;                       //Have to pre-declare 0, Why?
      return (~l&gt;&gt;&gt;32)&amp;~n;
  }
  </code></pre>
  
  <p>But what I wanted to do is use the 0 direct into the return statement instead of declaring it before in "long l", like this:</p>
  
  <pre><code>static long flippingBits(long n) {
      return (~0&gt;&gt;&gt;32)&amp;~n;            //Using 0 directly don't works.
  }
  </code></pre>
  
  <p>I also tried with parenthesis but is the same. After testing looks like it is not able to shift if I put the 0 directly.</p>
  
  <p>Why is giving me a different value?</p>