title: Boundary of 127 for integers in Java
body: <p>Out of curiosity: why do we have <strong>FALSE</strong> when the integer is greater than 127, for <code>Integer</code>s?</p>
  
  <pre><code>public class Main {
      public static void main(String[] args) {
          System.out.println(127 == 127); // case 1: true
          System.out.println(128 == 128); // case 2: true
          System.out.println(Integer.valueOf(127) == Integer.valueOf(127)); // case 3: true
          System.out.println(Integer.valueOf(128) == Integer.valueOf(128)); // case 4: FALSE
      }
  }
  </code></pre>