I need to sort a hash map according to the key.The key is a string(so I need to sort it alphabetically) and the value is an integer. I was trying to search online and found that tree set automatically sorts it once you put it. Could somebody guide me in the right direction as to how I could convert it into a tree set or maybe even if i could just sort it using a hash map.
Thanks in advance