File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes equals(),hashCode(),compareTo() Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "equals(),hashCode(),compareTo()" Watch "equals(),hashCode(),compareTo()" New topic
Author

equals(),hashCode(),compareTo()

sreedhar Lackka
Ranch Hand

Joined: Jul 05, 2008
Posts: 154
Hi All,

Thanks a lot in advance.

I am pretty much aware about equals(),hashCode(),compareTo() methods. But still I need to read and understand the usage and importance of these methods. Could any one give some explanation about these with examples.

Regards,
Sree
Hauke Ingmar Schmidt
Rancher

Joined: Nov 18, 2008
Posts: 371
The full contract with usage hints can be found in the JavaDocs: java.lang.Object, java.lang.Comparable.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Please SearchFirst. A similar question was asked just one or two weeks ago.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Shanky Sohar
Ranch Hand

Joined: Mar 17, 2010
Posts: 1046

There is so many questions,asked about these topic in this forum,Please search earlier posts.

SCJP6.0,My blog Ranchers from Delhi
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: equals(),hashCode(),compareTo()
 
Similar Threads
HashCode Call
Using a Comparator for the TreeSet class
Doubt in K&B SCJP 5: topic Maps
using collection objects override methods
I want to use a TreeSet, but my compare method isn't consistent with equals.