KnowledgeBoat Logo

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