This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
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 Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Comparator interface define equals method" Watch "Comparator interface define equals method" New topic

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

Joined: Oct 27, 2005
Posts: 19908

The Javadoc adds some extra rules on the method.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: Comparator interface define equals method