Skip to main content
1 of 7
maaartinus
  • 13.7k
  • 1
  • 36
  • 75

The code is pretty long and I've just complained on meta that there's no way to view it properly. So I restrict myself to a few comments and let others to comment on other aspects.

default:
    System.exit(0);

I'd never do that. It's like placing a bomb in the code. One day someone will want to reuse a part of it and there's no easy way to find out why it terminates.

Return a boolean and let the caller handle it. Throw a HangmanShouldStopException if using a boolean would be too clumsy. Do whatever but System.exit.

I also don't see why entering an illegal should stop the program instead of asking for a fix.

maaartinus
  • 13.7k
  • 1
  • 36
  • 75