title: Does int.class equal Integer.class or Integer.TYPE in Java?
body: <p>Let's imagine one retrieves the declaring type of a <code>Field</code> using reflection.</p>
  
  <p>Which of the following tests will correctly indicate whether one is dealing with an <code>int</code> or an <code>Integer</code>?</p>
  
  <pre><code>Field f = ...
  Class&lt;?&gt; c = f.getDeclaringClass();
  boolean isInteger;
  
  isInteger = c.equals(Integer.class);
  isInteger = c.equals(Integer.TYPE);
  isInteger = c.equals(int.class);
  
  isInteger = ( c == Integer.class);
  isInteger = ( c == Integer.TYPE);
  isInteger = ( c == int.class);
  </code></pre>