我对 TimeOfDay 对象有一个目标。我需要帮助编写 getTimeForDay 方法。稍后将提供代码。我想编写此方法,以便给定一个日历对象,它返回一个具有相同年、月和日的新日历对象,但具有与此实例关联的时间。代码是:
import java.util.Calendar;
public class TimeOfDayImpl implements TimeOfDay,Cloneable,Comparable<TimeOfDay> {
private byte minute;
private byte hour;
public TimeOfDayImpl(byte min,byte hr) {
// TODO Auto-generated constructor stub
}
@Override
public int compareTo(TimeOfDay o) {
// TODO Auto-generated method stub
return 0;
}
@Override
public byte hour() {
// TODO Auto-generated method stub
return 0;
}
@Override
public byte minute() {
// TODO Auto-generated method stub
return 0;
}
@Override
public Calendar getTimeForDay(Calendar referenceDay) {
referenceDay.getInstance();
referenceDay.
// TODO Auto-generated method stub
return null;
}
public TimeOfDay clone() throws CloneNotSupportedException
{
return (TimeOfDay) super.clone();
}
}