Answers for "java what happens to the items on an arraylist when it is deleted"

0

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);
Posted by: Guest on June-21-2021

Code answers related to "java what happens to the items on an arraylist when it is deleted"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language