Can any one tell me why this won't work for me:
if use a syso and print the users.get(i).getLogin() i get:Code:public static void mainMenu()
{
String userName, pass, string1;
Scanner scnr = new Scanner(System.in);
do{
System.out.print("Please enter User Name:");
userName = scnr.nextLine();
}while(!checkLogin(userName));
System.out.println("b");
}
public static boolean checkLogin(String userName){
for(int i = 0; i<users.size(); i++){
if(userName.equals(users.get(i).getLogin())){
return true;
}
}
System.out.println("User not found");
return false;
}
alan
brad
charlie
dan
eric
but if user input is any of the above it still print "User not found".
output so far:
Please enter User Name:alan
User not found
Please enter User Name:brad
User not found
Please enter User Name:charlie
User not found
Please enter User Name:dan
User not found
Please enter User Name:eric
User not found
Please enter User Name:

