title: Put from arraylist into array and remove it in for loop
body: <p>So i want to remove the Integer from the ArrayList that i already have put into the normal Array. </p>
  
  <p>What i have right now is:</p>
  
  <pre><code> int[] playersArray = null;
  
   ArrayList&lt;Integer&gt; spelers = new ArrayList&lt;Integer&gt;();
  </code></pre>
  
  <p>the table.length u see under here is the amount of tables there are, the table[j].length is the amount of players each table can get. It works good but it removes the wrong Integer from the PlayerList, it removes the next one, not the one thats put into the playersArray.</p>
  
  <pre><code> for(int j = 0; j &lt; table.length; j++){
       playersArray = new int[table[j].length];
       for(int i = 0; i &lt; table[j].length; i++){
           playersArray[i] = playersList.get(i);
           playersList.remove(i);
       }
       table[j] = playersArray;
       System.out.println("tafel: " + (j+1) + " " +   Arrays.toString(tafel[j]));
   }
  </code></pre>