Again the compiler is telling you exactly what is wrong. It's saying that compareTo must accept an
Object parameter, while you've written it to accept a GreetingCard parameter. You can do one of two things:
- Either change your compareTo method to one that accepts an Object parameter. If you do this, then inside the method you'll have to assign the parameter into a GreetingCard variable and will need to cast it to GreetingCard to do this.
- Or have your class implement the generic version of the interface, Comparable<GreetingCard>.
Regardless, remember that the compiler error messages are usually very helpful in figuring out a problem and in solving it.