hey all, just have a question about the java programming compareTo method. basically, I have to write my own version of this method. I have a class called DR, which basically has a document name and a total count of how many words in that document. The method has to return -1 if x.totalcount < y.totalcount, 1 if x.totalcount > y.totalcount, and 0 if and only if x.totalcount == y.totalcount and x.equals(y). But if x.totalcount == y.totalcount but the objects arent equal, how can I return a value such that x.compareTo(y) < 0 and y.compareTo(x) > 0 ? here is what I have. public int compareTo(DR d){ if (totalCount > d.totalCount) return -1; if (totalCount < d.totalCount) return 1; if (totalCount == d.totalCount) {if (!this.equals(d)) return ????? } return 0; } Thanks!