हिंदी

Which of the following returns a String? - Computer Applications

Advertisements
Advertisements

प्रश्न

Which of the following returns a String?

विकल्प

  • length()

  • charAt(int)

  • replace(char, char)

  • indexOf(String)

MCQ

उत्तर

replace(char, char)

Explanation:

The method replace(char oldChar, char newChar) returns a new String with all occurrences of oldChar replaced by newChar. This method does not modify the original string but produces a new one with the specified replacements.

shaalaa.com
String Array
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2024-2025 (April) Specimen Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×