The index of each subsequent element is reduced by 1, so indices remain sequential.
import java.util.ArrayList;
import java.util.List;
public class MainClass {
public static void main(String[] argv) {
List<String> list = new ArrayList<String>();
list.add("a");
list.add("b");
list.add("c");
Object o = list.remove(0);
System.out.println(o);
System.out.println(list);
}
}
|