So you should rewrite if(choice.toLowerCase() == "pass") break; as if(choice.toLowerCase().equals("pass")) break;
Ah, you're right! Thanks a bunch.
Here is the code:
import java.util.Scanner;
public class Test
{
public static void main(String[] args)
{
String choice = "default";
Scanner scan = new Scanner(System.in);
while(choice.toLowerCase() != "pass")
{
System.out.println("What do you do: ");
choice = scan.nextLine();
if(choice.toLowerCase() == "pass") break;
}
System.out.println("You broke out of the loop.");
}
}