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