收到此错误:整数不相容乔达和Java郎
incompatible types
required: java.lang.Integer
found: java.util.Map.Entry<org.joda.time.DateTime.java.lang.Integer>
,并导致错误的代码:
public static void checkRange() {
DateTime startx = new DateTime(startDate.getTime());
DateTime endx = new DateTime(endDate.getTime());
//produces submap
Map<DateTime, Integer> nav = map.subMap(startx, endx);
//this is the line causing the error:
for (Integer capacity : map.subMap(startx, endx).entrySet()) {
}
}
}
我已经的startDate和结束日期定义为日期较早的话,我在这里将其转换为u可以看到DateTime。我不认为这就是问题所在 和地图是
public static TreeMap<DateTime, Integer> map = new TreeMap<DateTime, Integer>();
感谢,
辉煌:D错误已经过去非常感谢...以及我没有清楚知道的好解释 –