import java.util.*;
public class ArrayListDemo extends ArrayList{
public static void main(String[] args) {
ArrayListDemo arrlist = new ArrayListDemo();
arrlist.add(10);
arrlist.add(12);
arrlist.add(31);
System.out.println("The list:" + arrlist);
arrlist.removeRange(0,2);
System.out.println("The list after using removeRange:" + arrlist);
}
}
输出
The list:[10, 12, 31]
The list after using removeRange:[31]