title: Wrapper class object as a return type
body: <p>It's a very simple question which I could not understand. I am still a beginner in Java.</p>
  
  <p>Consider a example:</p>
  
  <pre><code>public Integer function() {
      int i=1;
      return i;
  }
  </code></pre>
  
  <p>The return type is an <code>Integer</code> type and  I am returning a <code>primitive</code> type. It is allowed by the compiler. </p>
  
  <p>So the <strong>question</strong> is, how that conversion(primitive to wrapper) takes place.</p>
  
  <p>I am using <code>JDK 1.7</code>.</p>