I am trying to loop through my arraylist and print email addresses that are invalid. To be invalid, the address does not contain an @ sign or a period.
I am getting an error, int cannot be converted to charsequence for my method.
public static void print_invalid_emails(){
for (int i = 0; i < studentList.size(); i++) {
if (studentList.get(i).getEmail().contains('@' + '.')){
System.out.println("Scanning Roster");
}
else {
System.out.println("Invalid email address, " + studentList.get(i).getEmail());
}
}
}
The bug is here:
It should be: