I have a Map that has strings for both keys and values.
Data is like following:
\"question1\", \"1\" \"question9\", \"1\" \"que
List list = new ArrayList(); Map map = new HashMap(); for (String str : map.keySet()) { list.add(str); } Collections.sort(list); for (String str : list) { System.out.println(str); }