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

Sebastian Eguez
Sebastian Eguez
8,248 Points

What am I doing wrong?

https://w.trhou.se/clrmna0yiw

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"); 
        }
    }

}
Hangman.java:7: error: cannot find symbol                                                                                                
        boolean isHit = prompter.promptForGuess();                                                                                       
                                ^                                                                                                        
  symbol:   method promptForGuess()                                                                                                      
  location: variable prompter of type Prompter                                                                                           
1 error 

THANKS!

2 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Sebastian;

In your prompter.java your method name is promtForGuess. That is where the typo is.

Ken

codeoverload
codeoverload
24,260 Points

You mistyped the "promptForGuess" method in the Prompter class.

Sebastian Eguez
Sebastian Eguez
8,248 Points

I'm sorry. How did I mistype it?