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

Jun Dong
Jun Dong
4,754 Points

Game game = new game("treehouse");

just to make sure, the value of the new game object he made using the Game class is treehouse right?

1 Answer

Teacher Russell
Teacher Russell
16,873 Points

Hello Jun, "treehouse" is the answer to the hangman game, and it's being passed into the constructor, inside of the Game class, when we create this new instance of the game. So, by creating a new instance of Game, we create the answer. Does that make sense?