object.
I want to sort the map based on a property in my object.
How to do so.?
Hash map doesn't preserve ordering. You either need to create new tree map with your custom comparator and add all entries from hash map to it. Or manually sort entries in some list. But I'm sure a tree map will fit your needs.
Обсуждают сегодня