map.get(0)与map.get(0L)的问题

遇到的问题:map.get(0) = null,而map.get(0L) =100

Map<Long,Double> CategoryMoney = new HashMap<>();
// map中通过ItemMoney对象插入了几条数据,其中一条为:0 -》100
if(CategoryMoney.get(0L) != null){
        vo.setCombo(CategoryMoney.get(0L));
        totalMoney += CategoryMoney.get(0L);
  } 

public class ItemMoney {

    private double money;
    private Long superior;

    public ItemMoney(){ }
    public ItemMoney(double money,Long superior){
        this.money = money;
        this.superior = superior;
    }
}                          

 

Integer与Long的区别:https://blog.csdn.net/bigtree_3721/article/details/74573840

posted on 2019-07-26 11:19  永不宕机  阅读(1929)  评论(0编辑  收藏  举报

导航