title: What happens to the rest of an ArrayList once an object has been deleted within it?
body: <p>In Java, when you do this:</p>
  
  <pre><code>alist[0].remove();
  </code></pre>
  
  <p>What happens to the rest of the array list. Do all of the objects move up one or do they stay the same and there is just an empty index at [0]?</p>
  
  <p>If not, is there an efficient way of moving each object's index closer down by one?</p>
  
  <p>To clarify what I mean by more effecient:</p>
  
  <p>You could just remove the first index and then iterate through the ArrayList and delete each object and re-assign it to a new index, but this seems very ineffecient and it seems like there should be a way but I have looked through at the <a href="http://docs.oracle.com/javase/6/docs/api/java/util/ArrayList.html" rel="nofollow">JavaDoc page for the ArrayList class</a> and do not see anything that would accomplish what I am trying to do.</p>