System.out.print("\n\nPlease guess a letter: ");
String letter = TextIO.getln();
I would suggest you create another variable that is character type:
-char l = letter.charAt(0);
if(letter == theWord.substring(theWord.length()))
The part "theWord.substring(theWord.length())" is going to be null since what you're doing is basically grabbing the substring of a word between the end and...well, the end. (Read the API on the String class) I'd use a for loop to search through a word instead.
__________________
Looking out the window, that's an act of war. Staring at my shoes, that's an act of war. Committing an act of war? Oh you better believe that's an act of war
|