📌  相关文章
📜  如何在java代码示例中从arraylist中删除一个元素

📅  最后修改于: 2022-03-11 14:52:41.038000             🧑  作者: Mango

代码示例1
List 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);