Finding a character at an index

Java provides the charAt() method, which when called on a string, returns the character at the specified index.

For example, if the string is “Java” and the index is 22, then ‘v’ will be returned. Below is a demonstration.

Get hands-on with 1200+ tech skills courses.