Computer Science, asked by thomas1267, 1 year ago

output of the following;""dedicate".compareTo("devote")

Answers

Answered by iqrajamilsiddiqui
24

-18 is the answer of your ques dear


ansh00919: How
Answered by sailorking
26

Answer:

The answer to the question is "18". The reason for the answer is because the compare function is used to compare two strings, which are used by the help of ASCII code for each characters of the string. Here the ASCII code for d is 100 and for v is 118, and there is difference is 18, that is why the result is 18.

Explanation:

The mechanism of the compare function is done by checking the characters ASCII of two two strings, in correspondence with the index position of the character, if the ASCII of those characters are mismatched, then the difference of the ASCII value is returned.

Similar questions