How do you compareTo objects in Java?

The compareTo method defines the natural order; the default way for ordering objects of a class. It should return a negative integer(usually -1), if the current triggering object is less than the passed one, and positive integer (usually +1) if greater than, and 0 if equal.

Sizin İçin Seçtik  What are the RTTY frequencies?

Leave a Reply

Your email address will not be published. Required fields are marked *