📅  最后修改于: 2022-03-11 14:52:03.006000             🧑  作者: Mango
public static > void getDuplicates(T[] array) {
Set dupes = new HashSet();
for (T i : array) {
if (!dupes.add(i)) {
System.out.println("Duplicate element in array is : " + i);
}
}
}