Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at java.lang.String.charAt(String.java:686)
The code at line 686 is using an index past the end of the String. The index is shown as 0 which means that the String must be empty. The code should test the length of the String before trying to index into it to make sure there are characters in the String.
Please edit your post and wrap your code with code tags:
[code=java]
<YOUR CODE HERE>
[/code]
to get highlighting and preserve formatting.