Java program to find the most frequent element in an array
import java . util . HashMap ; import java . util . Map ; import java . util . Map . Entry ; class GFG { static int mostFrequent ( int arr [ ] , int n ) {