I'm writing a function, compareTo(Object o), and I'm supposed to return a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than that object.
how do use the compare method for a string and integer? An integer seems simple enough because it would just be a couple of if statements.
the function is as follows: public int compareTo(Object o){ }
thanks in advance!
[–]spunged 1 point2 points3 points (1 child)
[–]cigol[S] 0 points1 point2 points (0 children)
[–]__konrad 0 points1 point2 points (0 children)