title: What is .intValue() in Java?
body: <p>What is the difference between them?</p>
  
  <p><em><code>l</code> is an arraylist of Integer type.</em></p>
  
  <p>version 1:</p>
  
  <pre><code>int[] a = new int[l.size()];
  for (int i = 0; i &lt; l.size(); i++) {
      a[i] = l.get(i);
  }
  return a;
  </code></pre>
  
  <p>version 2:</p>
  
  <pre><code>int[] a = new int[l.size()];
  for (int i = 0; i &lt; l.size(); i++) {
      a[i] = l.get(i).intValue();
  }
  return a;
  </code></pre>