First: you did a good job on that - excellent progress. Just one problem with the sort:
The Map.Entry class does not implement Comparator, so it has no default or "natural" sort order. That's why you need to create your own Comparator for the sort. The code you found on the web is a good place to start - it defines a Comparator that compares Map.Entry objects by ignoring their keys and comparing their values.
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
Dinesh_9 0 Light Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster
Dinesh_9 0 Light Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
vighnesh.anap 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.