Here is my code (question listed below): import java.util.Scanner;
public class ExampleCode {
/**
* B. Stephens
*/
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
String secretPhrase = "show me the money";
boolean notDone = true;
while (notDone = true){
System.out.print("Guess the puzzle: ");
String puzzleGuess = input.nextLine();
if (puzzleGuess == secretPhrase) {
System.out.println("Congratulations! You guessed the puzzle!");
notDone = false;
}
}
} // end main
For some reason, the program isn't recognizing when my input (puzzleGuess) is the same as secretPhrase. It seems like there is no reason the correct input shouldn't end the program. Thanks for any help!