So I'm basically trying to make a part that checks to see if someone is registering a new account is trying to register with a name that's in an arraylist. Which currently has nothing in it. But my problem is, it keeps asking to enter a login over and over again. I thought I made it pretty clear to my computer that as long as its not used it should move on but apparently it doesn't think so o_O?
// start attempting new login boolean loginClear = false; boolean loginUsed = false; do { System.out.print("Login:"); newLogin = keyBd.next(); for (int i = 0; i < AAL.accArray.size(); i++) { if (AAL.accArray.get(i).getLogin().equals( newLogin)) { loginUsed = true; System.out.println("Bad login."); } else { loginClear = true; } } } while (loginClear == false);
This is what it prints:
Please select a menu option.
1. Login
2. Register
2
Please fill out the folling information:
Login:John
Login:Why are you asking me again fool?
Login:Login:Login:Login:Login:Login:Login:Wtf?
Login: