📅  最后修改于: 2022-03-11 14:52:08.098000             🧑  作者: Mango
public static void main(String[] args) {
ArrayList names = new ArrayList<>(Arrays.asList("Ahmed", "John", "Eric", "Ahmed"));
names.removeAll( Arrays.asList("Ahmed"));
System.out.println(names); // [John, Eric]