title: What is the difference between compare() and compareUnsigned() in Java
body: <p>I know <code>compare(int a, int b)</code> returns 1 if <code>a &gt; b</code>, 0 if <code>a == b</code>, -1 <code>a &lt; b</code>. When I faced to <code>compareUnsigned()</code> didn't get how does it function. I have done some research on the documentation of this method in IntelliJ Idea about this method and found out how does<br>
  <code>compareUnsigned()</code> static method work after it receives integer x and y as arguments :</p>
  
  <pre><code>public static int compareUnsigned(int x, int y) {
          return compare(x + -2147483648, y + -2147483648);
      }
  </code></pre>
  
  <p>Could anyone explain if there is any special feature of this method compared to <code>compare(int a, int b)</code> method and how does it do . </p>