|
home—info—exams—lectures—labs—hws
Recipe—Laws—lies—syntax—java.lang docs—java.util docs
The following two problems are only for those sections which talked about objects as inputs. (FWIW, the sections who have covered this, haven't yet brainstormed about design potentials for Dates -- what other fields and methods might go there, and how to represent them.)
For checking off, you only need to do one of the following two problems. However, either one would be fair game for the exam!
/** Do two dates represent the exact same day? * @param other The date to compare this Date against. * @return true if (and only if) this Date represents the same day as other. * (that is, the same year, month, day-of-month). */ boolean isEqualTo(Date other) |
/** Does one Date precede another? * @param other The date to compare this Date against. * @return true if (and only if) this Date comes before other. */ boolean isBefore(Date other) |
Since this method takes in an object as a parameter, you'll presumably want to review a similar program from yesterday's lecture.
home—info—exams—lectures—labs—hws
Recipe—Laws—lies—syntax—java.lang docs—java.util docs
©2007, Ian Barland, Radford University Last modified 2007.Aug.27 (Mon) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |