obtaining the most highly repeated entry in an arraylist

i have written a program which accepts a file from user and data is stored in an ArrayList named "employee". i need to find out the name which is repeated the most number of times. how do i get the most highly repeated name in the arraylist???

i have written a program which accepts a file from user and data is stored in an ArrayList named "employee". i need to find out the name which is repeated the most number of times. how do i get the most highly repeated name in the arraylist???

Use a Map<String, Integer> where the key is the name and the value the frequency of that name in your input. When it is entirely populated iterate over the Map to find the name (the key) with the largest frequency (the value).

kind regards,

Jos

I have the stamina of a seal; I lie on the beach instead of running on it.