Tag Archives: Explain Comparable

Difference between Comparator and Comparable in Java?

Difference between Comparator and Comparable in Java?

Difference between Comparator and Comparable in Java? Comparator[I] It is present in java.lang package and it contains only one method. compareTo();   If we are depending on default natural sorting order then while adding the object into the TreeSet JVM will call compareTo() method.  If default natural sorting order not available or if we are not satisfied with natural sorting order then ...

Read More »

Responsive WordPress Theme Freetheme wordpress magazine responsive freetheme wordpress news responsive freeWORDPRESS PLUGIN PREMIUM FREEDownload theme free