SleepyEgg

Tech News, Deals, & Games

  • Increase font size
  • Default font size
  • Decrease font size
Home News Tech News Comparable vs Comparator

Comparable vs Comparator

E-mail Print PDF
Comparable is an interface that an object can implement to compare itself with other object. If the return value is negative, that means it is less than the input object. If the return value is 0, that means it is equals to the input object, etc. Comparator is an interface that an object can implement to compare with TWO other objects. If the return value is negative, that means object one is less than object two. If the return value is 0, that means object one is equals to object tow, etc. We can use utility method in Collections class to do sorting with a comparator. Share Link:
Bookmark Google Yahoo MyWeb Del.icio.us Digg Facebook Myspace Reddit Ma.gnolia Technorati Stumble Upon
Comments (0)Add Comment

Write comment
quote
bold
italicize
underline
strike
url
image
quote
quote
smile
wink
laugh
grin
angry
sad
shocked
cool
tongue
kiss
cry
smaller | bigger

security code
Write the displayed characters


busy
 

Polls

Which is your favorite OS
 

Login

               No account yet?