List<Object> list= new ArrayList<>();//记录需要删除的元素List<Object> li = new ArrayList<>();//遍历for(Object obj :list){ if(obj == 2333){ li.add(obj); }}if(!li.isEmpty()){//不空//删除 list.removeAll(li);}System.out.println(list);