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 (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.