File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Java in General
diff b/w compare() and compareTo()
Joined: Jan 23, 2006
Feb 01, 2006 23:56:00
what is difference between compare() and compareTo()....
Thanks advance who ever answers this question.
Joined: Nov 24, 2005
Feb 02, 2006 00:10:00
which class ?
All roads lead to JavaRanch
Joined: Sep 16, 2005
Feb 02, 2006 05:18:00
Q: What's the diference between
A: A comparator compares two given objects, so there are three references involved:
if (String.CASE_INSENSITIVE_ORDER.compare(string1, string2)<0)...
A comparable compares (itself) to another object, so there are two refernces involved:
There is no emoticon for what I am feeling!
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
subject: diff b/w compare() and compareTo()
Using a Comparator in Collections
question about comparable and comparator
JDK 1.5 Collections.sort
About Comparator Interface
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014