Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
220,913 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.