我需要按以下順序對映射中提及的符號進行排序。
首先空白,秒*,**第三,第四小寫字母順序字母,按字母順序排列5大寫字母,按升序排列,最後的符號()java爲一些特殊字符,數字,字母和空格排在一起
Map<String, String> symbols = new HashMap<String, String>();
symbols.put("001","*");
symbols.put("002","**");
symbols.put("003"," ");
symbols.put("004","s");
symbols.put("005","A");
symbols.put("006","g");
symbols.put("007","f");
symbols.put("008","6");
symbols.put("009","9");
symbols.put("0010","()");
symbols.put("0011","*");
symbols.put("0012","10");
symbols.put("0013","Y");
symbols.put("0014","**");
symbols.put("0015","()");
symbols.put("0016","**");
symbols.put("0017"," ");
爲清楚起見第6號:最終解決方案就像我提到的那樣,將LinkedHashMap與排序記錄相結合。
什麼是你的問題?你的嘗試在哪裏? – Ezequiel 2014-11-01 10:26:12