手记

查找重复数组重复元素示例

    public Person[] find(String searchName) {
        Person[] p = new Person[a.length];
        int j = 0, k = 0;
        if (searchName != null)
            for (j = 0; j < nElems; ++j)
                if (a[j] != null && searchName.equals(a[j].getLast())) p[k++] = a[j];
        return p[0] == null ? null : p;

    }
0人推荐
随时随地看视频
慕课网APP