title: Primitive and Object comparison with == operator
body: <p>I am wondering what is the internal Java behaviour for the next snippet:</p>
  
  <pre><code>Long a = 123L;
  long b = 123;
  System.out.println("a equals b?: " + (a == b));
  </code></pre>
  
  <p>The result is <code>true</code> although comparing two <code>Long</code> objects would be <code>false</code> (because it compares their reference). It is Java converting <code>Long</code> object into its primitive value because detects <code>==</code> operator against another primitive object?</p>