I am trying to sort a set of String values from a HashMap into alphabetical order. So far i have a method which will perform the sort between two strings, but I cannot figure out how I can apply this to another data structure, e.g. a LinkedList, whereby I can search through all of the entries in the map and then place them in the correct order.
private Integer compareStrings(String string1, String string2){
return string1.compareTo(string2);
}
I realise that there probably is a way of doing this that is built-in to the API, but have had no luck finding it. Can anyone shed some light on this?
If I have not explained my problem fully, please let me know.
Regards
Will