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 | DigitalOceanā€
ā€œComparable vs Comparator in Java - GeeksforGeeksā€
ā€œDifference between Comparable and Comparator - javatpointā€
ā€œhttps://www.baeldung.com/java-comparator-comparableā€

1 Like

Okay bro . Thanks
Appreciated

1 Like