Welcome to the Treehouse Community
Looking to learn something new?
[SOLVED] What happens at this stage when you successfully guess the word?
I get a syntax error, for the loop exits only on a failure.
You have 3 tries left to solve: treehouse
Enter a letter:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
It turns out that this error occurs in the next lesson and is addressed in the lesson after that:
When reading from console we can get a zero length string. So,
"Zero Length String".charAt(0);
Returns an unhandled exception. This was handled by checking the length of string when reading from console and raising a known exception if it is of zero length.