English

Give the output of the following String class method: "devote". compareTo("DEVOTE")

Advertisements
Advertisements

Question

Give the output of the following String class method:

"devote". compareTo("DEVOTE")
Answer in Brief
Advertisements

Solution

32

Explanation:

The compareTo() function compares two strings and returns the difference in their ASCII codes.

shaalaa.com
  Is there an error in this question or solution?
2022-2023 (March) Official
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×