Computer Applications
State the purpose and return data type of compareTo() function.
Java String Handling
ICSE 2010
19 Likes
Answer
It compares two strings lexicographically. It results in the difference of the ASCII codes of the corresponding characters. Its return type is int.
Answered By
13 Likes
Related Questions
What is exception? Name two exception handling blocks.
State the purpose and return data type of indexOf() function.
Write a statement for each to perform the following task on a string:
Extract the second last character of a word stored in the variable wd.
Write a statement for each to perform the following task on a string:
Check if the second character of a string str is in upper case.