This code is a snippet from a Blackjack game I'm making. No matter what I enter, the program never breaks out of a loop.
boolean bool = true;
do{
Scanner kb = new Scanner(System.in);
String choice = kb.next();
if(choice == "Hit" || choice == "hit") {
String action = "hit";
bool = false;
} else if(choice == "Stay" || choice == "stay") {
String action = "stay";
bool = false;
} else {
System.out.println("Do not recognize response. Retry.");
}
} while (bool == true);
What normally happens: http://puu.sh/87KZk.png
Any help would be appreciated. Thanks!