Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java find duplicates in array

// Uses a set, which does not allow duplicates 

for (String name : names) 
{
     if (set.add(name) == false) 
     {
        // print name your duplicate element
     }
}
Source by javarevisited.blogspot.com #
 
PREVIOUS NEXT
Tagged: #java #find #duplicates #array
ADD COMMENT
Topic
Name
9+7 =