import java.util.*;
public class DuplicateValue {
public static void main(String args[]) {
int my_arr[] = { 1, 2, 3, 4, 5, 6, 7, 7, 9, 10 };
for (int i = 0; i < my_arr.length; i++) {
for (int j = 1; j < my_arr.length; j++) {
if ((my_arr[i] == my_arr[j]) && (i != j)) {
System.out.println("The duplicate element found at location" + i +
"and the duplicate element is " + my_arr[i]);
}
}
}
}
}