为什么getCal()
有效但getCal2()
无效?在 Eclipse 中,我收到一条错误消息“无法返回无效结果”
public Calendar getCal(long milliseconds) {
Calendar c = Calendar.getInstance();
c.setTimeInMillis(milliseconds);
return c;
}
public Calendar getCal2(long milliseconds) {
return Calendar.getInstance().setTimeInMillis(milliseconds);
}