Answers for "arraylist remove name in java"

10

remove item from arraylist in java

//Create the ArrayList
List<Integer> al = new ArrayList<>(); 
//Add the items
al.add(10);
al.add(18);
//Remove item(1 = 2and item in list)
al.remove(1);
Posted by: Guest on December-31-2019
0

arraylist remove name in java

public static void main(String[] args) {

ArrayList<String> names = new ArrayList<>(Arrays.asList("Ahmed", "John", "Eric", "Ahmed"));
    names.removeAll( Arrays.asList("Ahmed"));
    System.out.println(names); // [John, Eric]
Posted by: Guest on June-09-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language