Output:
Character at 0 position is: T
Character at 5th position is: i
Character at 22nd position is: M
Exception in thread “main” java.lang.StringIndexOutOfBoundsException: String index out of range: -1
Some important things about this Java charAt method: