Similarity and Difference between Comparator and Comparable interfaces

Below are Similarity and Difference between Comparator and Comparable interfaces

Similarity:
#1.Both are interfaces
#2.Both are used for specifying sorting order of the objects stored in a Collection

Difference:
#1.Packages they are available
Comparator interface is defined in java.util package, but Comparable interface is defined in java.lang package

#2.Methods they declare
Comparator interface declares method
public int compare (Object obj1, Object obj2) which returns a -ve, zero, or +ve integer as the first argument is less than, equal to, or greater than second respectively.

But Comparable interface declares method public int compareTo(Object obj)

#3.How to implement?
The class(whose objects need to be sorted) need to implement Comparable, and provide body for compareTo(Object obj) method.

Not the actual class(whose objects need to be sorted), but another class need to implement Comparator. Need to be sent as parameter while creating Collection, or to Collections.sort() method.

#4.Using Comparable, objects can be sorted only on one criteria. Using Comparator, objects can be sorted based on different criteria.

You may also like to read:
Comparable Example
Comparator Example