📜  高效的通用重复查找类java代码示例

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

代码示例1
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);
            }
        }

    }