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

Eric Tang
PLUS
Eric Tang
Courses Plus Student 1,300 Points

isHit

There is so much to learn in this one video. I'm worried i'll forget it all. There's some parts I get but some parts are a complete blur. For example, why do we declare boolean isHit = prompter.promptForGuess() when we already declared isHit in the game file. Didnt craig said not to repeat myself?

Steven Sullivan
Steven Sullivan
11,616 Points

There is so much to learn in this one video. I'm worried i'll forget it all

You probably will, and that's okay! This is your first go around. These are fundamentals that you will only retain by practicing. I did Java Objects three times to get it embedded in my head.

For example, why do we declare boolean isHit = prompter.promptForGuess() when we already declared isHit in the game file. Didnt craig said not to repeat myself?

If I remember correctly, it's because it's declared as a different data type in the game file.

1 Answer

Eric Tang
PLUS
Eric Tang
Courses Plus Student 1,300 Points

Hi Steven, I checked. It's both declared as boolean