wood burning stoves*
The moose likes Java in General and the fly likes Comparator interface define equals method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Comparator interface define equals method" Watch "Comparator interface define equals method" New topic
Author

Comparator interface define equals method

Vadim Vararu
Ranch Hand

Joined: Jan 03, 2009
Posts: 147
I've looked inside the jdk sources and, namely, in Comparator interface. I've found strange that Comparator interface define the method: "boolean equals(Object object)". Why does it define that method? Anyway, it's implemented in Object already?


If you think you've done too much, usually it means you've done too few.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

The Javadoc adds some extra rules on the method.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Comparator interface define equals method
 
Similar Threads
Difference between Comparable and Comparator
java.io.File problem
Sorting an ArrayList of Object X
Doubt about Comparator interface Implementation
Sorting