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