Why does java have an int and int Integer datatype and can I move data from one to another?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/7121581/why-can-integer-and-int-be-used-interchangably">Why can Integer and int be used interchangably?</a>  </p>
</blockquote>



<p>I am trying to understand the difference between these. Can I declare something to be an int for example and then compare this with a number that I put in an Integer? Also why does Java have the two. Why not just combine these?</p>

<p>Can someone help me by showing me a 3-4 line code example of how each is used?</p>
