I'm having trouble with a while loop in a Java program. I want to have a loop that has endless input until a certain input is reached, as an example if you run the program it would look like this "Enter a letter" (user enters b) "Your current input is B" "Enter another letter" (user enters c) "Your current input is BC"
My loop:
while (myLock.open() == false) {
System.out.println("Enter a letter: ");
String inputString = myScan.nextLine();
char inputTwo = inputString.charAt(0);
String inputStringKeeper = inputStringKeeper + inputTwo;
inputTwo = ' ';
System.out.println(myLock.setValue(inputStringKeeper) + " your current combo is " + inputStringKeeper);
}
just FYI the myLock method is a method that unlocks a "padlock" when a certain input is reached and will say either "unlocked" or "still locked" Sorry for the jumbled post, so hard to explain over text. Thanks!