Advertisement
Guest User

sau

a guest
Jul 3rd, 2015
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. The two ways are as follows:
  2.  
  3. Comparable interface:
  4. Class whose objects to be sorted must implement this interface.In this,we have to implement compareTo(Object) method.
  5.  
  6. Comparator interface:
  7. Class whose objects to be sorted do not need to implement this interface.Some third class can implement this interface to sort.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement