1.

What Do Mean By Comparable And Comparator Interfaces?

Answer»

The Java allows Comparable INTERFACE which always be implemented by any CUSTOM class if we want to use Arrays or Collections sorting techniques. The Comparable interfaces have COMPARED To (T obj) techniques. We always override this technique in such a way that it returns a negative integer, zero, or a PASSIVE integer if this object is less than, equal to, or LARGER than the object over as element.

The Java allows Comparable interface which always be implemented by any custom class if we want to use Arrays or Collections sorting techniques. The Comparable interfaces have compared To (T obj) techniques. We always override this technique in such a way that it returns a negative integer, zero, or a passive integer if this object is less than, equal to, or larger than the object over as element.



Discussion

No Comment Found