Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Java in General
Help required: sorting HashMap values
Nidhi Singhal
Ranch Hand
Posts: 89
I like...
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
I want to know how to sort values (not keys) in a HashMap
Thanks,
Nidhi
Sonny Gill
Ranch Hand
Posts: 1211
I like...
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
What problems did you run into while trying to do it?
Layne Lund
Ranch Hand
Posts: 3061
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You can create a list of the Map.Entry objects in the Map and sort them with a custom Comparator. See the link to the API docs in my sig for information on the Map.Entry class and the Comparator interface.
Layne
Java API Documentation
The Java Tutorial
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
[Solved] HashMap, Which thing defines the order of elements
disbling alt+tab key
Hashcode cache query
HashMaps
ThreadLocal use to store Key and Value (like hash map)
More...