What is Comparable and Comparator interface ? List their differences
What is Comparable and Comparator interface ? List their differences
Answer
Java provides the Comparable interface, which contains only one method, called compare To. This method compares two objects, in order to impose an order between them. Specifically, it returns a negative integer, zero, or a positive integer to indicate that the input object is less than, equal or greater than the existing object.
Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website.
If you are using this website then its your own responsibility to understand the content of the website