java list 删除指定元素

通过iterator删除
String code_first = "123";
Iterator iterator = list.iterator();
while(iterator.hasNext()){
TMP tmp = (TMP) iterator.next();
if(tmp.getCode().equals(code_first)){
iterator.remove();
}
}
list.add(0,radar_first);

 

参考文档:https://www.cnblogs.com/codehaogg/p/12541876.html

posted @ 2022-01-14 19:12  northli  阅读(368)  评论(0编辑  收藏  举报