date类有点不明白!
class Date{private int day;
private int month;
private int year;
public Date(int d,int m,int y){
day = d;
month = m;
year = y;
}
public int getDay(){
return day;
}
public int getMonth(){
return month;
}
public int year(){
return year;
}
public void display(){
System.out.println("Today is "+year+","+month+","+day);
}
public void succussorDate(){
int daysInMonth[]={31,28,31,30,31,30,31,31,30,31,30,31};
if(year%4==0&&(year%100!=0||year%400==0))
daysInMonth[1]=29;
if(day<daysInMonth[month])
day++;
else{
day=1;
if(month<12)
month++;
else{
month=1;year++;
}
}
}
public boolean equals(){
}
}
这个successordate方法是什么意思呢?