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

Sarabeth Zogg
Sarabeth Zogg
9,418 Points

Java object oriented. Why does Hangman need to break the program out to Prompter and Game?

Craig mentions this enables other users to use Game or Prompter for their own purposes but, lets face it, all the code in each of them is really specific to what we are doing in Hangman. Someone who is writing a Scrabble etc. program would basically wind up re-writing all the methods in them anyway, right? Meanwhile, there is a lot of code of one class calling another here? Wouldn't it work more simply to just keep the input/output (Prompter) and game logic (Game) inside Hangman?