Computer Science, asked by Anonymous, 6 months ago

differentiate between equals to()and compare()​

Answers

Answered by sainiakshita762
5

Explanation:

equals: Compares this string to the specified object. ... equals() checks if two objects are the same or not and returns a boolean. compareTo() (from interface Comparable) returns an integer. It checks which of the two objects is "less than", "equal to" or "greater than" the other.

please follow me❤

Similar questions