title: Cannot resolve method equals(java.lang.Long)
body: <p>The following code gives error (with IDEA) while I think it shouldn't.</p>
  
  <pre><code>Long[] a = {0L, 0L};
  Long[] b = {1L, 1L};
  if((a[0] + a[1]).equals(b[1]))
      System.out.println("Equal");
  </code></pre>
  
  <p>Says <code>cannot resolve method equals(java.lang.Long)</code>. But it works well with <code>if(a[0].equals(b[0]))</code>. I thought that plus operator would return a Long object. </p>
  
  <p>Why does it seem like it doesn't return a <code>Long</code> object, and how are we able to use <code>Long c = a[0] + a[1]</code> if it doesn't return a Long object? Or why can't we use <code>equals</code> like that?</p>