Hi All !
I have hashmap and its keys are like "folder/1.txt,folder/2.txt,folder/3.txt" and value has these text files data.
Now i am stucked. I want to sort this list. But it does not let me do it :( Here is my hashmap data type:
HashMap<String, ArrayList<String>>
following function work good but it is for arraylist not for hashmap.
Collections.sort(values, Collections.reverseOrder());
I also tried MapTree but it also didn't work, or may be I couldn't make it work. I used following steps to sort the code with maptree
HashMap testMap = new HashMap();
Map sortedMap = new TreeMap(testMap);
any other way to do it??
I have one doubt as my keys are (folder/1.txt, folder/2.txt ) may be that's why?