bg left bg right
      
  |  | 
Welcome to SleepyEgg Tech News and Coupon Deals!
Comparable vs Comparator PDF Print E-mail
(0 votes)
Written by Sleepy Egg   
Sunday, 31 July 2005
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.


Comments (0)add comment

Write comment
quote
bold
italicize
underline
strike
url
image
quote
quote
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley

security image
Write the displayed characters


busy
 


Valid XHTML 1.0 Transitional