Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to romve a element from arraylist in java

        List<Integer> al = new ArrayList<>();

        al.add(10);
        al.add(20);
        al.add(30);
        al.add(1);
        al.add(2);
// This makes a call to remove(index) and 
// removes element 20.
        al.remove(1);        
// Now element 30 is moved one position back
// So element 30 is removed this time
        al.remove(1);
 
PREVIOUS NEXT
Tagged: #romve #element #arraylist #java
ADD COMMENT
Topic
Name
6+7 =