System.out.println("what is your name? ");
String name = kb.nextLine();
for(int i = 0; i < member2.size(); i++){
if(member2.get(i).equals(name)){
System.out.println(name + " is a member. ");
break;
}
else{
System.out.println(name +" is not a member. ");
break;
}
i did a system.out.println on the member2 arraylist (String arraylist) and it prints out the correct stuff. when comparing whether or not name is equal to an item in the arraylist, it always give me the else statement even if the name is in the list.
for example, member2 contains:
"john"
"william"
"xxxxx"
and then i would type in "john", and it gives me "john is not a member."