Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSan Francisco
28,373 PointsGetting an error although my code seems to be exactly what is in the video example.
Not sure why I'm getting this error:
treehouse:~/workspace$ javac Hangman.java
./Prompter.java:15: error: reached end of file while parsing
}
^
1 error
Here is my code:
public class Hangman {
public static void main(String[] args) {
// Enter amazing code here:
Game game = new Game("treehouse");
Prompter prompter = new Prompter(game);
boolean isHit = prompter.promptForGuess();
if (isHit) {
System.out.println("We got a hit!");
} else {
System.out.println("Nope");
}
}
}
'''
2 Answers
Wesley Seago
10,424 Pointserror: reached end of file while parsing
is a problem with your curly braces. From the code posted, you have the correct opening and closing braces, but I suspect if you examine the entire file, you will find an errant brace somewhere.
Also, I have found the workspace to be a little buggy at times myself. Make sure everything is saved before you run it.
San Francisco
28,373 PointsWoah, totally missed the fact that this was in the promptor file...while it is staring right at me! lol...thanks guys!
Craig Dennis
Treehouse TeacherCraig Dennis
Treehouse TeacherAlso note the error is in the Prompter file!