count repeated elements in an 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
}
}