do/while loop

PHOTO EMBED

Fri Sep 23 2022 15:57:37 GMT+0000 (Coordinated Universal Time)

Saved by @testpro #java

String password = "let me in";
Scanner scanner = new Scanner(System.in);
String guess;

do
{
  System.out.println("Guess the password:");
  guess =  scanner.nextLine();
}while(!guess.equals(password);
content_copyCOPY