title: compare Long value in java
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7672317/integer-int-allowed-in-java">Integer == int allowed in java</a>  </p>
  </blockquote>
  
  
  
  <p>What is the difference between the following two statements</p>
  
  <pre><code>Long l1 = 2L;
  if(l1 == 2)
      System.out.println("EQUAL");                         
  if(l1.longValue() == 2)
      System.out.println("EQUAL");
  </code></pre>
  
  <p>They both are giving same result "EQUAL".But my doubt is Long is object. How is it equal?</p>