I'm working on a project in school and I need to verify 5 email address from an arraylist.
I have to verify that all emails have '@' and '.' and don't have a space. Right now I'm just trying to get first part down.
This is what I have so far and when it calls it pulls all 5 email addresses. It seems like the contains would check for the chars and only return false on the emails that don't have it. I'm not looking for word for word answer. Just a bit of direction.
public static void print_invalid_emails()
{
for (Student s : myRoster )
{
if(s.getEmailAddress().contains("@.") == false)
System.out.println("Invalid Email: " + s.getEmailAddress());
}
}