Answers for "how to get duplicate elements in array in java"

4

java array check duplicates

duplicates = false;

for(i = 0; i < zipcodeList.length; i++) {
	for(j = i + 1; k < zipcodeList.length; j++) {
  		if(j != i && zipcodeList[j] == zipcodeList[i]) {
   	  		duplicates = true;
		}
	}
}
Posted by: Guest on February-15-2020
0

find repeated elements in array java

for (String name : names) {
     if (set.add(name) == false) {
        // your duplicate element
     }
}
Posted by: Guest on February-26-2021

Code answers related to "how to get duplicate elements in array in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language