Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Java find duplicate items

System.out.print("Duplicate Characters in above string are: ");
for (int i = 0; i < str.length(); i++) {
   for (int j = i + 1; j < str.length(); j++) {
      if (carray[i] == carray[j]) {
         System.out.print(carray[j] + " ");
         break;
      }
   }
}
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #Java #find #duplicate #items
ADD COMMENT
Topic
Name
7+8 =