Can compareTo compare 3 integers? Reason I am asking is because I need to have a method that compares the month, day, and year to see if they are equal.
No, the traditional definition of compareTo only takes one argument - the object you're comparing against.
compareTo
You should use an object that encapsulates the month, day, and year - that should be what you pass to your compareTo method instead of the raw values.
No, the traditional definition of
compareTo
only takes one argument - the object you're comparing against.You should use an object that encapsulates the month, day, and year - that should be what you pass to your
compareTo
method instead of the raw values.