Hi,
I am trying to write a method to compare date of births to one another. The code below is a method called compareTo(Date d) which takes in a Date object and tries to compare the date of birth of the another Date object?
Thanks
Code:public int compareTo(Date d)
{
if(year > d.year || month > d.month || day > d.day)
return 1;
else if(year < d.year || month < d.month || day < d.day)
return -1;
else
return 0;
}

