/*
* 日期比较Date对象中compareTo()
* 返回值:-1,0,1
*/
Date fromDate =...
Date toDate = ...
int num = fromDate.compareTo(toDate);
if(num >0)
{
System.out.println("fromDate>toDate");
}
else if(num ==0)
{
System.out.println("fromDate=toDate");
}
else
{
System.out.println("fromDate<toDate");
}