java code find element in an array repeated twice 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
}
}