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 Programmer Certification (SCJP/OCPJP) and the fly likes compareTo and compare 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 » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "compareTo and compare " Watch "compareTo and compare " New topic
Author

compareTo and compare

Sanjeev Singh
Ranch Hand

Joined: Nov 01, 2006
Posts: 381
Hi Ranchers,
Can anybody please explain
How the compareTo() and compare() method is used by Collections for sorting and serching?


~Sanjeev Singh<br />SCJP 1.5
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: compareTo and compare