Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What is the value returned by function compareTo() if the invoking string is less than the string compared?

a) zero
b) value less than zero
c) value greater than zero
d) none of the mentioned

Answer: b
Explanation: 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.

Join The Discussion