实际上,我很难理解这种类型的错误。
有谁知道我怎么改正密码的吗?谢谢
CheckIn checkin1 = new CheckIn(location1, dt);
CheckInMonths checkInMonths = new CheckInMonths();错误发生在这一行, checkin1出了问题
checkInMonths.months.putIfAbsent(month,checkin1);其他代码:
class CheckIn {
Location location;
DateTime dateTime;
CheckIn(this.location, this.dateTime);
}
class CheckInMonths {
Map<Month, CheckIn> months = new Map();
}发布于 2014-12-27 11:55:14
putIfAbsent的第二个参数必须是返回CheckIn值(putIfAbsent)的函数。
checkInMonths.months.putIfAbsent(month, () => checkin1);https://stackoverflow.com/questions/27666462
复制相似问题