HashMap不存储对象。不知道为什么

时间:2016-05-09 00:03:09

标签: java object hashmap

以下是我的代码:

function daysLeft(BigDay, today) {
msPerDay = 24 * 60 * 60 * 1000;
timeLeft = (BigDay.getTime() - today.getTime());
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);

return daysLeft;
}
todayToBigday = daysLeft(new Date("6 August, 2017"), new Date("3 August,2016"));
/*
todayToBigday = daysLeft(
new Date("6 August, 2017"), //bigdate
new Date("3 August, 2012")  //today or other starting day
);*/

var date2016 = $('#date2016'),
    date2017 = $('#date2017');

date2016.html(todayToBigday + ' days from now');
date2017.html(todayToBigday + ' days from now');

由于某种原因,运行HashMap.put(),但生成的booklist对象不包含BookData对象,而只是在其中放置一个空值。我已经调试并检查了参数' bd'包含一个BookData对象(它确实如此),那为什么它最终不会出现在hashmap中呢?

0 个答案:

没有答案