I am writing a program to get a user to enter a list of 10 names or to enter "ZZZ" when finished less than 10. I need the program to count the names, but not the "ZZZ". It is counting the "ZZZ". How can I fix this?
for (int n = 0; n <= 10; n++) {
System.out.println("Enter name");
names[n]= input.nextLine();
/*Count names, but don't count ZZZ*/
count++;//???How do I do this???
}