Computer Science, asked by ankitasaloafer, 1 year ago

\huge\bold\blue{gimme}
\huge\bold\green{the}
\huge\bold\blue{answer}

Attachments:

Answers

Answered by RaGhAv200407
2

The string compareTo() method compares the given string with current string lexicographically (length wise or character wise). It compares strings on the basis of Unicode value of each character in the strings.

Your code :

"cable".compareTo("cadet") has equal lengths, so it would return -2 as the output because b < d (as d exceeds b by 2, in unicodes as well.)

Answered by bluestar21
0

\huge\bold\blue{gimme}

\huge\bold\green{the}

\huge\bold\blue{answer}

Similar questions