How print out the contents of a HashMap in ascending order based on its values?

前端 未结 13 1504
春和景丽
春和景丽 2020-12-24 11:58

I have this HashMap that I need to print out in ascending order according to the values contained in it (not the keys

相关标签:
13条回答
  • 2020-12-24 12:55
     SmartPhone[] sp=new SmartPhone[4];
     sp[0]=new SmartPhone(1,"HTC","desire","black",20000,10,true,true);
     sp[1]=new SmartPhone(2,"samsung","grand","black",5000,10,false,true);
     sp[2]=new SmartPhone(14,"google nexus","desire","black",2000,30,true,false);
     sp[3]=new SmartPhone(13,"HTC","desire","white",50000,40,false,false);
    
    0 讨论(0)
提交回复
热议问题