title: How do I remove sequential elements from a Java ArrayList?
body: <p>I'm a relatively new Java programmer and I'm having difficuly removing more than one element from an ArrayList.  Ideally I'd like to do something like this:</p>
  
  <pre><code>ArrayList ar1 = new ArrayList();
  ar1.add(...)
  ar1.add(...)
  ar1.add(...)
  ar1.add(...)
  
  for (int i = 0; i &lt; 2; i++){
       ar1.remove(i);
  }
  </code></pre>
  
  <p>I think iterator might help, but I can't find an example that matches close enough to what I'm trying to do.  Any help would be appreciated.  Thanks.</p>