English

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

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?
Chapter 10: String Handling - Exercises [Page 249]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 10 String Handling
Exercises | Q 6. (b) | Page 249
Advertisements
Share
Notifications



      Forgot password?
Use app×