Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


How to get the number of repeated values(count) from list in java


Assume I have a List the following values

emp1, emp2, emp3, emp2, emp1, emp4, emp1

I need to get the number of times a string is repeated such as the following

emp1 - 3 times  
emp2 - 2 times  
emp3 - 1 times  
emp4 - 1 times  

I am trying to implement this by using map. Is this the correct way or is there any better way?

 


asked Jun 22, 2015 in Core java by rahulgii
0 votes
64 views



Related Hot Questions



Walkin Jobs Opening



Government Jobs Opening


...