Iterator<LoginConfigBean> it = list.iterator(); while (it.hasNext()) { LoginConfigBean bean = it.next(); String codeOld[] = bean.getCode().split(","); if (codeOld.length != code.length) { it.remove(); } }
for(int i=list.size()-1;i>=0;i--) { User result = list.get(i); if (result.getId() == 3) { list.remove(result); System.err.println("id: " + result.getId() + "\tname: " + result.getName()); } }
标签:codeOld,删除,元素,list,remove,getId,bean,result,某个 From: https://www.cnblogs.com/cuijinlong/p/16995653.html