how to print the repeated elemnets in an array in 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
}
}