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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM