title: Conversion Object[] to int[] error
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/960431/how-to-convert-listinteger-to-int-in-java">How to convert List&lt;Integer&gt; to int[] in Java?</a>  </p>
  </blockquote>
  
  
  
  <p>I have an <code>ArrayList</code> and when I try to convert it into an Array of Integer because I need to do operations which concerns integer, I get this error : </p>
  
  <blockquote>
    <p>incompatible types<br>
      required: int[]<br>
      found:    java.lang.Object[]</p>
  </blockquote>
  
  <p>Here's my code :</p>
  
  <pre><code>List&lt;Integer&gt; ids_rdv = new ArrayList&lt;Integer&gt;();
  
  // I execute an SQL statement, then :
  while (resultat.next()) {
      ids_rdv.add(resultat.getInt("id_rdv"));
  }
  int[] element_rdv_id = ids_rdv.toArray(); //Problem
  </code></pre>
  
  <p>Do you have any idea about that?</p>