aspose file tools*
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
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: 19697
    
  20

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Comparator interface define equals method