Online Java Compiler By
JavaTpoint.com
import java.util.ArrayList; public class ArrayListRemoveRangeExample2 { ArrayList
letters = new ArrayList<>(); letters.add("A"); letters.add("B"); letters.add("C"); letters.add("D"); // indexes: 0, 1, 2, 3 System.out.println(letters); // [A, B, C, D] letters.removeRange(0, 5); // throw IndexOutOfBoundsException }
Output