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 (Retired) Creating the MVP Prompting for Guesses

Robert Spring
Robert Spring
3,349 Points

Error: cannot find symbol Prompter

Below 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("Whoops that was a miss");
}

}

}

I get the following error when trying to compile:

Hangman.java:6: error: cannot find symb
Prompter prompter = new Prompter(ga
^
symbol: class Prompter
location: class Hangman
Hangman.java:6: error: cannot find symb
Prompter prompter = new Prompter(ga
^
symbol: class Prompter
location: class Hangman
2 errors

2 Answers

Nikita Struggs
Nikita Struggs
2,642 Points

getting the same error. i am using workspaces

Robert,

Try making sure you have import java.io.Console; written in the first line of your Prompter.java file. That should fix the problem.