0

I'm not sure why guess isn't the same as words[random][0] even if I type the correct answer. It skips the if statment and goes to else.

    do{

System.out.println("The scrambled word is: " + scramble[random]);

                Scanner fooBar = new Scanner(System.in);

                System.out.println("What is this word?: ");
                guess = fooBar.next();

                if(guess == words[random][0])
                {
                    System.out.println("Congratulations, you have guessed correctly!");
                    done = true;
                }
            else
                System.out.println("Sorry, that is not it.");

            }while(done == false);
Quaxton Hale
  • 2,460
  • 5
  • 40
  • 71

0 Answers0