📌  相关文章
📜  数组删除java代码示例中的重复项

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

代码示例3
Listnumbers = Arrays.asList(1,2,2,2,3,5); // [1, 2, 3, 5]
System.out.println(numbers);

Set hashSet = new LinkedHashSet(numbers);
ArrayList removedDuplicates = new ArrayList(hashSet);
System.out.println(removedDuplicates); // [1, 2, 3, 5]