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

Don't understand this line

Don't understand how this line works.

return mGame.applyGuess(guess);

1 Answer

Alexander Nikiforov
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 Points

First it calls method named applyGuess defined in class Game that takes a char and returns a boolean value.

Saying in human words, when you write applyGuess(someChar) in the Game class is checked whether passed char is in Answer of the Game

And if this char called guess is in Answer then true is returned, if it is not false

When you write return whatever value returns applyGuess method is passed to return of the method where it was called.

That is all I can say.... May be you can re-phrase what exactly is not understandable for you ...