Question
What is the value returned by unction compareTo() if the invoking string is less than the string compared?
Answer: Option B
Was this answer helpful ?
compareTo() function returns zero when both the strings are equal, it returns a value less than zero if the invoking string is less than the other string being compared and value greater than zero when invoking string is greater than the string compared to.
Was this answer helpful ?
Submit Solution