📜  java代码示例中的arraylist删除名称

📅  最后修改于: 2022-03-11 14:52:08.098000             🧑  作者: Mango

代码示例1
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]