Q-2 Describe the working mechanism of charAt() function.
Answers
Answered by
1
What does the Charat () method do?
- The charAt() method returns the character at the specified index in a string. The index of the first character is 0, the second character is 1, and so on.
Answered by
2
Answer:
The java string charAt() method returns a char value at the given index number. The index number starts from 0 and goes to n-1, where n is length of the string. It returns StringIndexOutOfBoundsException if given index number is greater than or equal to this string length or a negative number.
Explanation:
mark me as brilliant
Similar questions