How to find more than 2 duplicate elements in array java code example
Example: find repeated elements in array java
for (String name : names) {
if (set.add(name) == false) {
// your duplicate element
}
}
for (String name : names) {
if (set.add(name) == false) {
// your duplicate element
}
}