⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 date.java

📁 Java程序设计(美) David D. Riley著 机械工业出版社 书籍配套 代码
💻 JAVA
字号:
// Figure 9.21public abstract class Date  {	protected int day;  	// day within a month	protected Month month;  	protected int year;   // full calendar year (A.D.)	/**	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 Date( int d, Month m, int y )  {    	day = d;    	month = m;    	year = y;    }	/**	post:	result is the last two digits of year  */	public String twoDigitYear()   {		return "" + year % 100;	}	/**	post:	result is some appropriate string form of the date  */	public abstract String dateString();    	/**	post:	result is the month name followed by day coma year */    public String toString()   {		return "" + month.name() + " " + day + ", " + year;	}        public boolean equals( Object z )   {		return 			z instanceof Date			&& day == ((Date)z).day  			&&  month == ((Date)z).month  			&&  year == ((Date)z).year;	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -