Comparator Vs Comparable

Iā€™m not able to get the exact difference between comparable and comparator if someone could tell and how the compareTo and compare functions respectively arrange the data in ascending or descending order.
Thanks.

buddy this is not a CP question , this is java language question u have to google it before posting here , there are many good references there.

1 Like

ā€œComparable and Comparator in Java Example - JournalDevā€
ā€œComparable vs Comparator in Java - GeeksforGeeksā€
ā€œDifference between Comparable and Comparator - javatpointā€
ā€œComparator and Comparable in Java | Baeldungā€

1 Like

Okay bro . Thanks
Appreciated

1 Like