老師是不是寫錯了
System.out.println("成功刪除:"+students.get(s).name+"對象。");
students.remove(s);
難道不應(yīng)該這樣,老師的是下面的這樣:都刪除了那還能獲取到對象
students.remove(s);
System.out.println("成功刪除:"+students.get(s).name+"對象。");
System.out.println("成功刪除:"+students.get(s).name+"對象。");
students.remove(s);
難道不應(yīng)該這樣,老師的是下面的這樣:都刪除了那還能獲取到對象
students.remove(s);
System.out.println("成功刪除:"+students.get(s).name+"對象。");
2016-08-09
舉報(bào)
2016-08-09
他是先獲取要刪除的對象的姓名 ?打印提示而已
然后再調(diào)用remove 刪除,你要是先刪除就獲取不了對象了