Home > Back-end >  Rewrite the compareTo () method, prompt always resvole metho, beg god to help and see where is wrong
Rewrite the compareTo () method, prompt always resvole metho, beg god to help and see where is wrong

Time:10-06



Code as shown in figure, a exercises, but according to the solutions to such an error, don't understand what is the problem, please answer,

CodePudding user response:

The Data may not implement this method

CodePudding user response:

Are you sure not date

CodePudding user response:

Hold down CTRL points to see, the estimate is the Data of this class is no compareTo method,
Another possibility is there are two or more Data types, you bring the wrong class, you can delete the import, to lead a see if there are multiple Data classes under the different package

CodePudding user response:

refer to the original poster Barubear response:
code as shown in figure, a exercises, but according to the solutions to such an error, don't understand what is the problem, please answer,


You refer to the Date class error, Java. Util. The Date, you refer to is what!

CodePudding user response:

Import the wrong Date of the class
  • Related