首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

Hashmap排序相关有关问题!多谢

2011-12-20 
Hashmap排序相关问题!谢谢!我在hashmap里保存如下内容:classcontent{StringidStringnameintorderpublic

Hashmap排序相关问题!谢谢!
我在hashmap里保存如下内容:
class   content{
      String   id   ;
      String   name;
      int   order;
public   content(){
    this.id     =id
    this.name=name;
    this.order=order;
}
}

HashMap   hm=   new   HashMap();
hm.put( "1 ",new   content( "1 ", "张三 ",2));
hm.put( "2 ",new   content( "2 ", "张四 ",1));
hm.put( "3 ",new   content( "3 ", "张五 ",3));

我想问一下,现在如何我想换content对像中的order排序输出,有没有好办法啊?
谢谢各位啊!



[解决办法]
hashmap不支持排序,


你可以用sortmap

热点排行
Bad Request.