ArrayList中的remove方法詳解

ArrayList類中一共給出了兩種remove方法,下面來對這兩種方法詳解: 1、參數爲元素下標(int型) 對於這個方法,裏面的參數是要刪除元素的下標,我們可以使用students(arraylist定義的對象名).remove(students.indexOf(stu(類定義的對象名)))如下(只是示範,具體的自己寫): static List<Student> students = new
相關文章
相關標籤/搜索