Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

duplicate array values

public class Main {
public static void main(String[] args) {
  int[] arr1 = {1,2,3,3,4};
  for (int i = 0; i < arr1.length-1 ; i++) {
    for (int j = 0; j < arr1.length; j++) {
      if (arr1[i]==arr1[j] && (j != i)){
      System.out.println("array's duplicate number: " +
      arr1[j]);
      	}
      }
    }
	}
}
Source by practicum.yandex.com #
 
PREVIOUS NEXT
Tagged: #duplicate #array #values
ADD COMMENT
Topic
Name
9+9 =