• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

hi all

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi can anybody please explain the Comparable and Comparator interface?
 
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What exactly would you like to know beyond the facts detailed in the Javadoc documentation for Comparable and Comparator?
 
Ranch Hand
Posts: 341
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
mamtaR roy,
Welcome to JavaRanch.

Please take time to choose the subject line. It makes good sense if it something relevant e.g. for this post "Comparable vs Comparator" or "What is the difference between comparable and comparator" makes more sense.
Hope you have a wonderful time here.Wish you good luck.

In short we may say, comparator is used to compare two different objects. and comparable allows itself to compare with another similar object.

A ver good explanation can be seen on this blog.

Hope that helps.
[ March 13, 2008: Message edited by: Anubhav Anand ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic