title: Error: ArrayList is already defined in this compilation unit
body: <p>The following code produces this compling error:</p>
  
  <p>ArrayList is already defined in this compilation unit</p>
  
  <pre><code>import java.util.*;
  
  public class FirstApp{
  
  public static void main(String[] args){
  Scanner scan = new Scanner(System.in);
  ArrayList&lt;Integer&gt; list = new ArrayList&lt;Integer&gt;();
  while(scan.hasNextInt()){
     list.add(scan.nextInt());
  }
  Integer[] nums = new  Integer[list.size()];
  nums = list.toArray(nums);
  for(int i = 0;i &lt; nums.length; i++){
  System.out.println(nums[i]);
  }
  }
  }
  </code></pre>