हिंदी

Explain the utility of java.lang.String class.

Advertisements

प्रश्न

Explain the utility of java.lang.String class.

स्पष्ट कीजिए
Advertisements

उत्तर

  1. String Creation: The String class is used to create and store a sequence of characters as a single object.
  2. String Concatenation: It allows two or more strings to be joined together using the concat() method or the + operator.
  3. String Comparison: It provides methods such as equals() and compareTo() to compare the contents of strings.
  4. String Length: It provides the length() method to determine the number of characters present in a string.
  5. Character Extraction: It provides the charAt() method to access a character at a specified position in a string.
  6. String Manipulation: It provides methods such as toUpperCase(), toLowerCase() and substring() to perform various operations on strings.
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 5: Primitive Values, Wrapper Classes, Types and Casting - EXERCISE [पृष्ठ ११२]

APPEARS IN

धीरज मेहरोत्रा Computer Science [English] Class 12
अध्याय 5 Primitive Values, Wrapper Classes, Types and Casting
EXERCISE | Q 7. | पृष्ठ ११२
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×