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 trial

Java Java Objects Creating the MVP Prompting for Guesses

Edward Toonela
Edward Toonela
3,044 Points

Hangman.java:8: error: cannot find symbol

All the code should be identical to the instructor. I tried packaging and looked for typing errors, but I just can't wrap my head around where the mistake is located at.

Snapshot: https://w.trhou.se/z17335gq7g

Full-length description of the error:

Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
Hangman.java:8: error: cannot find symbol
boolean isHit = prompter.promptForGuess();
^
symbol: method promptForGuess()
location: variable prompter of type Prompter
1 error

1 Answer

Steven Parker
Steven Parker
231,236 Points

The Hangman module is referencing a method named "promptForGuess" (capital "F"), but in the Prompter module, the method is defined as "promptforGuess" (lower-case "f").

Edward Toonela
Edward Toonela
3,044 Points

Thanks a million! I didn't know to look for it there like that, but it seems so obvious now.