Online Java Compiler By
JavaTpoint.com
import java.util.ArrayList; public class ArrayListRemoveExample1 { ArrayList
letters = new ArrayList<>(); letters.add("A"); letters.add("B"); letters.add("C"); letters.add("D"); letters.add("E"); System.out.println(letters); // [A, B, C, D, E] System.out.println(letters .remove("C")); // prints true System.out.println(letters); // [A, B, D, E] }
Output