About 2,910,000 results
Open links in new tab
  1. Remove objects from an ArrayList based on a given criteria

    To remove elements from ArrayList based on a condition or predicate or filter, use removeIf() method. You can call removeIf() method on the ArrayList, with the predicate (filter) passed as …

  2. ArrayList removeIf(): Remove Elements Matching a Condition

    Aug 7, 2023 · Java ArrayList.removeIf() method removes all elements that satisfy a condition by iterating through the elements of the current arraylist and matching them against the condition …

  3. How to Remove Elements from ArrayList based on Condition in Java?

    To remove elements from ArrayList based on a condition or predicate or filter, use removeIf() method. You can call removeIf() method on the ArrayList, with the predicate (filter) passed as …

  4. How to remove an element from ArrayList in Java?

    Jan 4, 2025 · There are 3 ways to remove an element from ArrayList as listed which later on will be revealed as follows: Using remove() method by indexes(default) Using remove() method by …

  5. Removing Elements from Java Collections - Baeldung

    Jan 8, 2024 · Java 8 introduced a new method to the Collection interface that provides a more concise way to remove elements using Predicate: names.removeIf(e -> e.startsWith("A")); It’s …

  6. Remove Elements from ArrayList in Java - Java Guides

    Removing elements from an ArrayList in Java can be done using several methods, including by index, by value, using an iterator, and using the removeIf method with streams. Each method …

  7. java - How to remove element from ArrayList by checking its …

    Snippet to remove a element from any arraylist based on the matching condition is as follows: List<String> nameList = new ArrayList<>(); nameList.add("Arafath"); nameList.add("Anjani"); …

  8. How to Remove Elements from an ArrayList in Java: A …

    Use the remove (int index) method to remove an element by its index. This is the most straightforward method. To remove the first occurrence of a specific value from the ArrayList, …

  9. How to Remove Element from Array based on a Condition in Java

    To remove an element from an array based on a condition in Java, you can use the `ArrayList` class and its `removeIf` method to remove elements that match the condition. We create an …

  10. ArrayList removeIf() Method in Java with Examples

    Dec 11, 2024 · The Java ArrayList removeIf () method is used to remove all elements from the ArrayList that satisfy a given predicate filter. The predicate is passed as a parameter to the …

Refresh