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 Storing Guesses

Nicolas Hampton
Nicolas Hampton
44,625 Points

Craig, everyone gets NoSuchElementException error when they game in repl b/c you only show the return for a split sec


While you were making the applyGuess method, Craig quickly makes the return isHit boolean and then it scrolls out of screen view. It only shows for a split second and he never comes back to it, so everyone has been making this error. As applyGuess is suppose to return a boolean, I see people have been substituting void instead of boolean to make this work, which is a problem later on when this method has to indicate a hit or miss in the game, but returns nothing without the return. Please fix the view in the video, though thanks for the error, it really helped me get used to the repl and debugging.


1 Answer

Craig Dennis
Craig Dennis
Treehouse Teacher

Awesome, thanks for pointing that out! I'll get some notes in there to make sure no one else encounters that!


Hello Craig, I'd like to ask if you have any general tips for taking your java course. I found myself fully able to answer your code challenges up until Creating the MVP. I've had to grab the answer from ppl several times from the community. I follow what you're saying in the videos and follow what you're doing but when I get to the code challenges, I am lost. I'm trying to adopt a "way of thinking in Java" so that I can better tackle the challenges w/out help. Do you have any pointers?