English

Give the output of the following String class method: "COMMENCEMENT".lastIndex0f('M') - Computer Applications

Advertisements
Advertisements

Question

Give the output of the following String class method:

"COMMENCEMENT".lastIndexOf('M')
Answer in Brief
Advertisements

Solution

8

Explanation:

The lastIndexOf('M') returns the index of the last occurrence of 'M' in the string.

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

Englishहिंदीमराठी


      Forgot password?
Use app×