advanced code snippet search
multani on 10/20/08
javahashmap
10/20/08 09:13am
URL: http://levi.bloghome.cn/posts/120920.html
HashMap按key排序 HashMap map = new HashMap(); map.put("0201", "0201"); map.put("01", "01"); map.put("0304", "0304"); map.put("0101", "0101"); Object[] key = map.keySet().toArray(); Arrays.sort(key); for (int i = 0; i < key.length; i++) { System.out.println(map.get(key[i])); }
Report this snippet Tweet
Comment:
You need to login to post a comment.