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 trialAmanda Oliver
624 Pointsreached end of file while parsing. workspace
What am I doing wrong?
public class Hangman {
public static void main(String[] args) {
// Enter amazing code goes 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("Whoops that was a miss");
}
}
2 Answers
Simon Coates
28,694 PointsThe code you posted is definitely missing a closing }. I copied your code into my existing Hangman workspace, ran compile and got the error. Added a } at the end, saved and compile worked.
Adam Brown
12,453 PointsAssuming the "public class Hangman {" before your code block is in your code, then you are missing a final curly brace to close out the Hangman class.
Amanda Oliver
624 PointsAmanda Oliver
624 PointsI tried adding and subtracting a curly bracket at the end. Still didn't work. my code looks identical to Craig's