Hangman java coding

Basically, the logic of your showWord method is wrong. But rather than correcting it for you I’m just going to give you a HINT … in the form of a question.

  • Where does your code test the 2nd character of the “guess”?

The other thing to note is that your representation of word as an array of String objects is “unnatural”. The natural representation is String, with char[] being a possible alternative.

I mention this primarily because your current choice of representation is making your code more convoluted than it needs to be.

Leave a Comment