• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

diff b/w compare() and compareTo()

 
amit bhadre
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is difference between compare() and compareTo()....
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which class ?
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q: What's the diference between java.util.Comparator and java.lang.Comparable?

A: A comparator compares two given objects, so there are three references involved:

A comparable compares (itself) to another object, so there are two refernces involved:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic