English

State the purpose and return data type of the following String function: compareTo() - Computer Applications

Advertisements
Advertisements

Question

State the purpose and return data type of the following String function:

compareTo() 

Answer in Brief

Solution

This function checks the equality of two strings. It examines if a String is larger, smaller, or equal to another String. It returns a value that can be negative, positive, or zero. The return type of this function is integer (int).

shaalaa.com
  Is there an error in this question or solution?
Chapter 4: String Handling - EXERCISES [Page 289]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 4 String Handling
EXERCISES | Q VII. 2. (b) | Page 289
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×