Online Java Compiler By
JavaTpoint.com
import java.util.ArrayList; public class ArrayListRemoveExample2 { ArrayList
birds = new ArrayList<>(); birds.add("Parrot"); birds.add("Owl"); birds.add("Swallow"); System.out.println(birds); // [Parrot, Owl, Swallow] System.out.println(birds .remove("Heron")); // prints false System.out.println(birds); // [Parrot, Owl, Swallow] }
Output