I'm getting an error i really don't know why:
ERROR:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at java.lang.String.charAt(Unknown Source)
at Hangman.checkLetter(Hangman.java:172)
at Hangman.userGuess(Hangman.java:111)
at Hangman.main(Hangman.java:39
CODE:
for(int i = 0; i< MAX_WORD_LENGTH; i++){
if(word.charAt(i) == userLetter){//checking if the letter is in the word
wordSoFar[i] = userLetter;
}//end if
}//end for