title: Integer vs. int comparison
body: <p>I am new to <code>java</code>. I am now learning the non-primitive Integer type in <code>java</code>. 
  I know the following comparison is not valid and throws a compilation error - </p>
  
  <pre><code>String str = "c";
  Char chr = 'c';
  if(str == chr) return true;
  </code></pre>
  
  <p>The above code snippet gives me the  - "Test.java:lineNumber: incomparable types: java.lang.String and char" errors.</p>
  
  <p>But I found the following code snippet compiles fine -  </p>
  
  <pre><code>int a = 1234;
  Integer aI = 1234;
  if(a==aI) return true; 
  </code></pre>
  
  <p>Here, <code>a</code> is primitive int and <code>aI</code> is non-primitive. So how they are comparable? I am new to programming, may be is there any thing I don't know.</p>
  
  <p>Thanks</p>