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
You must be logged in to a comment. Please register if you do not have an account yet.

busy
 

Polls

Which has the best Graphic?
 

Login

               No account yet?