title: Why is 128==128 false but 127==127 is true when comparing Integer wrappers in Java?
body: <pre><code>class D {
      public static void main(String args[]) {
          Integer b2=128;
          Integer b3=128;
          System.out.println(b2==b3);
      }
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>false
  </code></pre>
  
  <hr>
  
  <pre><code>class D {
      public static void main(String args[]) {
          Integer b2=127;
          Integer b3=127;
          System.out.println(b2==b3);
      }
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>true
  </code></pre>
  
  <p>Note: Numbers between -128 and 127 are true.</p>