import java.util.*; public class FindFrequency { public static void findFrequency(int[] array){ HashMap hashMap = new HashMap<>(); // Declare the HashMap. // Compute the frequency of an array elements for(int index=0; index e : hashMap.entrySet()) System.out.println(e.getKey()+ ": " + e.getValue()); } public static void main(String[] args) { Scanner scan = new Scanner(System.in); int sizeOfArray = 0; // declare the sizeOfArray variable. System.out.print("Enter the size of an array: "); // Message for user. sizeOfArray = scan.nextInt(); // Take input from the user. int[] array = new int[sizeOfArray]; // Declare the array of size sizeOfArray. System.out.println("Enter the elements in an array :"); // Message for user. for(int index=0; index