Finding Duplicates in Array and printing them only Once
问题 I am trying to loop through my array and find all the numbers that are repeating more than once: E.G: if there is 1 1 2 3 4 It should print saying "1 repeats more than once" Here is my code and so far what I have tried, however it prints all duplicates and keep going, if there is 4 4 4 4 3 6 5 6 9 , it will print all the 4's but i dont want that: class average { public static void main(String[] args) throws IOException { int numOfLines = 0; int sum = 0, mean = 0, median = 0, lq = 0, uq = 0;