title: java Long datatype comparison
body: <p>Why does the code below return <strong>false</strong> for <strong>long3 == long2</strong> comparison even though it's literal.</p>
  
  <pre><code>public class Strings {
  
      public static void main(String[] args) {
          Long long1 = 256L + 256L;
          Long long2 = 512L;
          Long long3 = 512L;
          System.out.println(long3 == long2);
          System.out.println(long1.equals(long2));
      }
  }
  </code></pre>