Re: Hangman Java Code Error
'guess' is a primitive of type char. You can't call methods on a primitive type - they are not objects.
You need to either convert the char to a String or convert the String to a char (which you can only do if the String contains exactly one character).
Re: Hangman Java Code Error
it is easier to convert a character to a string one of the constructors in the string class takes the argument an array of characters. You can then use the equals method from the string class to compare two strings
Re: Hangman Java Code Error
one of the most common mistake I've seen people do in Java is compare one string with another with an == sign this is the wrong approach as all variables in Java I mean the class variables are in essence pointers so what you're doing is comparing one pointer with another pointer please be mindful of this