【Java开源代码栏目提醒】:网学会员Java开源代码为您提供OldAmericanDate.java参考,解决您在OldAmericanDate.java学习中工作中的难题,参考学习。
// Figure 9.23
public class OldAmericanDate extends Date {
/** pre: 1 <= m <= 12
* and d is a sensible day for month m
* (Note that this method doesn't check date validity) <br>
* post: day == d and month == m and year == y
*/
public OldAmericanDate( int d, Month m, int y ) {
super(d, m, y);
}
/** post: result is a string in the form
* "day d during the month of m in the year of our Lord, y"
* where d, m and y are, respectively, day, month & year.
*/
public String dateString() {
return "day " + day + " during the month of " + month.name()
+ " in the year of our Lord, " + year;
}
}