0

thank you for your help, greatly appreciate it but every time I try to run this program i get this error:

Exception in thread "main" java.io.FileNotFoundException: mails.txt (The system
cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.util.Scanner.<init>(Scanner.java:636)
at CheckMail.main(CheckMail.java:12)
Press any key to continue . . .

0

sure you will get this message;
CHange the name "mails.txt" to the name of your file where you put the data.

0

the file where each record contains a student's last name (one word only) and email address.

0

As far as you are concerned with String validation of email addres,
you may use Regular Expression in Java...
eg.

String email = "abcd_09@daniweb.com";
boolean isValidEmail = email.matches("[\\w.]+@[\\w]+\\.[\\w]+");

Edited by sawant_nitesh: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.