• Post Reply Bookmark Topic Watch Topic
  • New Topic

count of Duplicate key which is of type object in hashMap key  RSS feed

 
premchand Singh
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hj,

I have a hashmap which contains duplicate values,



i want to find out the employee number which is duplicate, also the count of the number of employee name i.e how many times it has occurred.
i have written the logic, but not able to find the count of occurrances...




your suggestion/solution will be a great help for me...

thanks in advance :
Premchand
 
Roel De Nijs
Sheriff
Posts: 11338
177
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
premchand Singh wrote:your suggestion/solution will be a great help for me...

When people get an assignment, they almost start coding right away. But that's often not the right approach, it's sometimes much better to turn off your computer and take a pencil and a paper and start writing down the steps required to solve the problem without using a computer. Once you have listed these steps, you can start converting them into Java.

So which steps are required to get the duplicate employee numbers? And which steps are required to keep track of the occurences of an employee name?

PS. Always use code tags when posting code to the forums. Unformatted or unindented code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please click this link ⇒ UseCodeTags ⇐ for more information. Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers. I've gone ahead and added the code tags for you. See how much easier the code is to read?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!